當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GeneratorCommand::buildClass方法代碼示例

本文整理匯總了PHP中Illuminate\Console\GeneratorCommand::buildClass方法的典型用法代碼示例。如果您正苦於以下問題:PHP GeneratorCommand::buildClass方法的具體用法?PHP GeneratorCommand::buildClass怎麽用?PHP GeneratorCommand::buildClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Console\GeneratorCommand的用法示例。


在下文中一共展示了GeneratorCommand::buildClass方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: buildClass

 /**
  * Build the class with the given name.
  *
  * @param  string $name
  * @return string
  */
 protected function buildClass($name)
 {
     $stub = parent::buildClass($name);
     $modelName = $this->getModelClass($name);
     $this->replaceModelNamespace($stub, $modelName)->replaceModelClass($stub, $modelName)->replaceBaseRepositoryNamespace($stub, $this->base)->replaceBaseRepositoryClass($stub, $this->base);
     return $stub;
 }
開發者ID:czim,項目名稱:laravel-repository,代碼行數:13,代碼來源:MakeRepositoryCommand.php

示例2: buildClass

 /**
  * Build the class with the given name.
  *
  * @param  string  $name
  * @return string
  */
 protected function buildClass($name)
 {
     $stub = parent::buildClass($name);
     $stub = str_replace('DummyCommand', class_basename($this->option('command')), $stub);
     $stub = str_replace('DummyFullCommand', $this->option('command'), $stub);
     return $stub;
 }
開發者ID:qasem2rubik,項目名稱:laravel,代碼行數:13,代碼來源:HandlerCommandCommand.php

示例3: buildClass

 /**
  * Build the class with the given name.
  *
  * Remove the base controller import if we are already in base namespace.
  *
  * @param  string  $name
  * @return string
  */
 protected function buildClass($name)
 {
     $this->info('<info>Created Controller:</info> ' . $name);
     $namespace = $this->getNamespace($name);
     $class = str_replace("use {$namespace}\\Controller;\n", '', parent::buildClass($name));
     $class = str_replace('{{modelName}}', $this->option('model'), $class);
     return str_replace('{{view}}', $this->option('view'), $class);
 }
開發者ID:aiddroid,項目名稱:laravel-curd-generator,代碼行數:16,代碼來源:MakeCurdControllerCommand.php

示例4: buildClass

 /**
  * Build the class with the given name.
  *
  * @param  string  $name
  * @return string
  */
 protected function buildClass($name)
 {
     $class = parent::buildClass($name);
     if ($this->option('markdown')) {
         $class = str_replace('DummyView', $this->option('markdown'), $class);
     }
     return $class;
 }
開發者ID:jarnovanleeuwen,項目名稱:framework,代碼行數:14,代碼來源:NotificationMakeCommand.php

示例5: buildClass

 /**
  * @param string $name
  *
  * @return string
  */
 protected function buildClass($name)
 {
     $stub = parent::buildClass($name);
     $table = Str::plural(Str::snake(class_basename($this->argument('name'))));
     $this->table = str_replace('._', '_', $table);
     $stub = str_replace('DummyTable', $this->table, $stub);
     return $stub;
 }
開發者ID:vampirekiss,項目名稱:lumen-restful-starter-kit,代碼行數:13,代碼來源:ModelMakeCommand.php

示例6: buildClass

 protected function buildClass($name)
 {
     $stub = parent::buildClass($name);
     $repository = config('repository.base_repository', Repository::class);
     $this->replaceRepository($stub, $repository);
     $this->replaceModel($stub);
     return $stub;
 }
開發者ID:znck,項目名稱:repository,代碼行數:8,代碼來源:RepositoryMakeCommand.php

示例7: buildClass

 /**
  * Build the class with the given name.
  *
  * @param  string  $name
  * @return string
  */
 protected function buildClass($name)
 {
     $fqModelClass = $this->parseModelName($this->argument('name'));
     $stub = parent::buildClass($name);
     $stub = str_replace('{FQModelClass}', $fqModelClass, $stub);
     $stub = str_replace('{Listener}', class_basename($name), $stub);
     return $stub;
 }
開發者ID:elodex,項目名稱:elodex,代碼行數:14,代碼來源:MakeSyncHandler.php

示例8: buildClass

 /**
  * Build the class with the given name.
  *
  * @param string $name
  *
  * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
  * @return string
  */
 protected function buildClass($name)
 {
     $stub = parent::buildClass($name);
     list($resourceStub, $actionStub) = explode('#split', $stub);
     if ($this->option('model')) {
         $modelClass = Str::singular(str_replace('.', '\\', $this->getNameInput()));
         $resourceStub = str_replace(['DummyModelClass'], [$modelClass], $resourceStub);
         return trim($resourceStub);
     }
     return trim($actionStub);
 }
開發者ID:vampirekiss,項目名稱:lumen-restful-starter-kit,代碼行數:19,代碼來源:ApiMakeCommand.php

示例9: buildClass

 /**
  * Build the class with the given name.
  *
  * @param  string  $name
  * @return string
  */
 protected function buildClass($name)
 {
     $stub = parent::buildClass($name);
     $event = $this->option('event');
     if (!Str::startsWith($event, $this->laravel->getNamespace())) {
         $event = $this->laravel->getNamespace() . 'Events\\' . $event;
     }
     $stub = str_replace('DummyEvent', class_basename($event), $stub);
     $stub = str_replace('DummyFullEvent', $event, $stub);
     return $stub;
 }
開發者ID:manhvu1212,項目名稱:videoplatform,代碼行數:17,代碼來源:ListenerMakeCommand.php

示例10: buildClass

 /**
  * Build the class with the given name.
  *
  * @param  string  $name
  * @return string
  */
 protected function buildClass($name)
 {
     $stub = parent::buildClass($name);
     $event = $this->option('event');
     if (!starts_with($event, $this->getAppNamespace())) {
         $event = $this->getAppNamespace() . 'Events\\' . $event;
     }
     $stub = str_replace('{{event}}', class_basename($event), $stub);
     $stub = str_replace('{{fullEvent}}', $event, $stub);
     return $stub;
 }
開發者ID:ayurmedia,項目名稱:faveo-helpdesk,代碼行數:17,代碼來源:HandlerEventCommand.php

示例11: buildClass

 /**
  * @param string $name
  *
  * @return string
  */
 protected function buildClass($name)
 {
     $stub = parent::buildClass($name);
     $event = $this->option('event');
     if (!Str::startsWith($event, $this->laravel->getNamespace()) && !Str::startsWith($event, 'Illuminate')) {
         $event = $this->laravel->getNamespace() . 'Events\\' . $event;
     }
     $stub = str_replace('DummyDatetime', Carbon::now()->toDateTimeString(), $stub);
     $stub = str_replace('DummyEvent', class_basename($event), $stub);
     $stub = str_replace('DummyFullEvent', $event, $stub);
     return $stub;
 }
開發者ID:notadd,項目名稱:framework,代碼行數:17,代碼來源:ListenerMakeCommand.php

示例12: buildClass

 /**
  * Build the class with the given name.
  *
  * @param  string  $name
  * @return string
  */
 protected function buildClass($name)
 {
     $stub = parent::buildClass($name);
     $model = $this->option('model');
     return $model ? $this->replaceModel($stub, $model) : $stub;
 }
開發者ID:davidhemphill,項目名稱:framework,代碼行數:12,代碼來源:PolicyMakeCommand.php

示例13: buildClass

 /**
  * Build the class with the given name.
  *
  * @param  string  $name
  * @return string
  */
 protected function buildClass($name)
 {
     $class = parent::buildClass($name);
     return $class;
 }
開發者ID:tokenly,項目名稱:laravel-api-provider,代碼行數:11,代碼來源:MakeAPIModelCommand.php

示例14: buildClass

 /**
  * Build Model Class
  *
  * @author Verron Knowles <Verron.Knowles@develme.com>
  * @param $name
  * @return void
  */
 protected function buildClass($name)
 {
     // Schema information
     $table_name = $this->getTableName($name);
     $columns_info = $this->getTableColumns($table_name);
     // Get stub data for class contents
     $stub_data = $this->getStubData($columns_info);
     // Get class contents for the stub
     $contents = $this->buildClassContents($name, $stub_data);
     // Let Laravel do the basics
     $parentBuild = parent::buildClass($name);
     $replacements = array_merge(compact('contents'), $this->otherTags);
     // Insert contents
     $this->replaceTag($parentBuild, $replacements);
     // Hand off to Laravel to finish
     return $parentBuild;
 }
開發者ID:develme,項目名稱:schema-wireframe,代碼行數:24,代碼來源:SchemaGeneratorCommand.php

示例15: buildClass

 /**
  * Build the class with the given name.
  *
  * @param  string  $name
  * @return string
  */
 protected function buildClass($name)
 {
     $class = parent::buildClass($name);
     $class = str_replace('DummyModelClass', trim($this->laravel->getNamespace(), '\\') . '\\Models\\' . $this->argument('name'), $class);
     return $class;
 }
開發者ID:tokenly,項目名稱:laravel-api-provider,代碼行數:12,代碼來源:MakeAPIRespositoryCommand.php


注:本文中的Illuminate\Console\GeneratorCommand::buildClass方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。