Abstract Class Yiisoft\Yii\Cycle\Schema\Conveyor\SchemaConveyor
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
| Subclasses | Yiisoft\ |
Protected Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $container | \ |
Yiisoft\ |
|
| $conveyor | array | Yiisoft\ |
Public Methods
Property Details
protected array $conveyor = [
self::STAGE_INDEX => [
\ Cycle\ Schema\ Generator\ ResetTables::class,
],
self::STAGE_RENDER => [
\ Cycle\ Schema\ Generator\ GenerateRelations::class,
\ Cycle\ Schema\ Generator\ GenerateModifiers::class,
\ Cycle\ Schema\ Generator\ ValidateEntities::class,
\ Cycle\ Schema\ Generator\ RenderTables::class,
\ Cycle\ Schema\ Generator\ RenderRelations::class,
\ Cycle\ Schema\ Generator\ RenderModifiers::class,
\ Cycle\ Schema\ Generator\ ForeignKeys::class,
],
self::STAGE_USERLAND => [],
self::STAGE_POSTPROCESS => [
\ Cycle\ Schema\ Generator\ GenerateTypecast::class,
],
]
self::STAGE_INDEX => [
\
],
self::STAGE_RENDER => [
\
\
\
\
\
\
\
],
self::STAGE_USERLAND => [],
self::STAGE_POSTPROCESS => [
\
],
]
Method Details
| public mixed __construct ( \ | ||
| $container | \ |
|
public function __construct(protected ContainerInterface $container) {}
| public void addGenerator ( string $stage, mixed $generator ) | ||
| $stage | string | |
| $generator | mixed | |
public function addGenerator(string $stage, $generator): void
{
$this->conveyor[$stage][] = $generator;
}
| public array getGenerators ( ) |
public function getGenerators(): array
{
$result = [];
foreach ($this->conveyor as $group) {
foreach ($group as $generatorDefinition) {
$generator = null;
if (is_string($generatorDefinition)) {
$generator = $this->container->get($generatorDefinition);
} elseif ($generatorDefinition instanceof GeneratorInterface) {
$result[] = $generatorDefinition;
continue;
} elseif (is_object($generatorDefinition) && is_callable($generatorDefinition)) {
$generator = $generatorDefinition($this->container);
}
if ($generator instanceof GeneratorInterface) {
$result[] = $generator;
continue;
}
throw new BadGeneratorDeclarationException($generator ?? $generatorDefinition);
}
}
return $result;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.