当前位置: 首页>>代码示例>>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;未经允许,请勿转载。