Final Class Yiisoft\Yii\Cycle\Schema\Provider\FromConveyorSchemaProvider
| Inheritance | Yiisoft\Yii\Cycle\Schema\Provider\FromConveyorSchemaProvider |
|---|---|
| Implements | Cycle\Schema\Provider\SchemaProviderInterface |
Public Methods
Method Details
| public mixed __construct ( Yiisoft\Yii\Cycle\Schema\SchemaConveyorInterface $conveyor, \Cycle\Database\DatabaseProviderInterface $dbal ) | ||
| $conveyor | Yiisoft\Yii\Cycle\Schema\SchemaConveyorInterface | |
| $dbal | \Cycle\Database\DatabaseProviderInterface | |
public function __construct(
private SchemaConveyorInterface $conveyor,
private DatabaseProviderInterface $dbal,
) {
}
| public static array config ( list<Closure|\Cycle\Schema\GeneratorInterface|string> $generators ) | ||
| $generators | list<Closure|\Cycle\Schema\GeneratorInterface|string> |
Additional {@see \Yiisoft\Yii\Cycle\Schema\SchemaConveyorInterface::STAGE_USERLAND} generators |
public static function config(array $generators): array
{
return [
'generators' => $generators,
];
}
| public array|null read ( \Cycle\Schema\Provider\SchemaProviderInterface|null $nextProvider = null ) | ||
| $nextProvider | \Cycle\Schema\Provider\SchemaProviderInterface|null | |
#[\Override]
public function read(?SchemaProviderInterface $nextProvider = null): ?array
{
$generators = $this->getGenerators();
$schema = (new Compiler())->compile(new Registry($this->dbal), $generators);
return count($schema) !== 0 || $nextProvider === null ? $schema : $nextProvider->read();
}
| public self withConfig ( array $config ) | ||
| $config | array | |
#[\Override]
public function withConfig(array $config): self
{
$new = clone $this;
$new->generators = $config['generators'] ?? [];
return $new;
}
Signup or Login in order to comment.