Final Class Yiisoft\Yii\Cycle\Schema\Provider\FromConveyorSchemaProvider
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Cycle\ |
Public Methods
Method Details
| public mixed __construct ( Yiisoft\ | ||
| $conveyor | Yiisoft\ |
|
| $dbal | \ |
|
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 \ |
public static function config(array $generators): array
{
return [
'generators' => $generators,
];
}
| public ?array read ( ?\ | ||
| $nextProvider | ?\ |
|
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 | |
public function withConfig(array $config): self
{
$new = clone $this;
$new->generators = $config['generators'] ?? [];
return $new;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.