本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例13: buildClass
/**
* Build the class with the given name.
*
* @param string $name
* @return string
*/
protected function buildClass($name)
{
$class = parent::buildClass($name);
return $class;
}
示例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;
}
示例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;
}