Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- declare(strict_types=1);
- use Cycle\ORM\Schema;
- use Cycle\ORM\Relation;
- use Cycle\Schema\Relation\RelationSchema;
- return [
- 'user' => [
- Schema::DATABASE => 'default',
- Schema::TABLE => 'user',
- Schema::ENTITY => 'App\\Entity\\User',
- Schema::MAPPER => 'Yiisoft\\Yii\\Cycle\\Mapper\\TimestampedMapper',
- Schema::REPOSITORY => 'App\\User\\UserRepository',
- Schema::CONSTRAIN => null,
- Schema::PRIMARY_KEY => 'id',
- Schema::COLUMNS => [
- 'id' => 'id',
- 'login' => 'login',
- 'passwordHash' => 'password_hash',
- 'passwordResetToken' => 'password_reset_token',
- 'emailVerificationToken' => 'email_verification_token',
- 'email' => 'email',
- 'emailVerified' => 'email_verified',
- 'created_at' => 'created_at',
- 'updated_at' => 'updated_at',
- ],
- Schema::TYPECAST => [
- 'id' => 'int',
- 'emailVerified' => 'bool',
- 'created_at' => 'datetime',
- 'updated_at' => 'datetime',
- ],
- Schema::RELATIONS => [
- 'name' => [
- Relation::TYPE => 1,
- Relation::TARGET => 'user:name',
- Relation::LOAD => Relation::LOAD_EAGER,
- Relation::SCHEMA => [],
- ],
- 'accounts' => [
- Relation::TYPE => Relation::HAS_MANY,
- Relation::TARGET => 'account',
- Relation::LOAD => Relation::LOAD_PROMISE,
- Relation::SCHEMA => [
- Relation::CASCADE => true,
- Relation::NULLABLE => false,
- Relation::WHERE => [],
- Relation::INNER_KEY => 'id',
- Relation::OUTER_KEY => 'user_id',
- ],
- ],
- ],
- ],
- 'account' => [
- Schema::DATABASE => 'default',
- Schema::TABLE => 'account',
- Schema::ENTITY => 'App\\Entity\\Account',
- Schema::MAPPER => 'Yiisoft\\Yii\\Cycle\\Mapper\\TimestampedMapper',
- Schema::REPOSITORY => 'App\\Account\\AccountRepository',
- Schema::CONSTRAIN => null,
- Schema::PRIMARY_KEY => 'id',
- Schema::COLUMNS => [
- 'id' => 'id',
- 'name' => 'name',
- 'type' => 'type',
- 'active' => 'active',
- 'created_at' => 'created_at',
- 'updated_at' => 'updated_at',
- 'user_id' => 'user_id',
- ],
- Schema::TYPECAST => [
- 'id' => 'int',
- 'active' => 'bool',
- 'created_at' => 'datetime',
- 'updated_at' => 'datetime',
- 'user_id' => 'int',
- ],
- Schema::RELATIONS => [
- 'balance' => [
- Relation::TYPE => 1,
- Relation::TARGET => 'account:money',
- Relation::LOAD => Relation::LOAD_EAGER,
- Relation::SCHEMA => [],
- ],
- 'user' => [
- Relation::TYPE => Relation::BELONGS_TO,
- Relation::TARGET => 'user',
- Relation::LOAD => Relation::LOAD_PROMISE,
- Relation::SCHEMA => [
- Relation::CASCADE => true,
- Relation::NULLABLE => false,
- Relation::INNER_KEY => 'user_id',
- Relation::OUTER_KEY => 'id',
- ],
- ],
- ],
- ],
- 'user:name' => [
- Schema::DATABASE => 'default',
- Schema::TABLE => 'user',
- Schema::ENTITY => 'App\\Entity\\Name',
- Schema::MAPPER => 'Cycle\\ORM\\Mapper\\Mapper',
- Schema::REPOSITORY => 'Cycle\\ORM\\Select\\Repository',
- Schema::CONSTRAIN => null,
- Schema::PRIMARY_KEY => 'id',
- Schema::COLUMNS => [
- 'firstname' => 'firstname',
- 'middle' => 'middle',
- 'lastname' => 'lastname',
- 'id' => 'id',
- ],
- Schema::TYPECAST => [
- 'id' => 'int',
- ],
- Schema::RELATIONS => [],
- ],
- 'account:money' => [
- Schema::DATABASE => 'default',
- Schema::TABLE => 'account',
- Schema::ENTITY => 'App\\Entity\\Money',
- Schema::MAPPER => 'Cycle\\ORM\\Mapper\\Mapper',
- Schema::REPOSITORY => 'Cycle\\ORM\\Select\\Repository',
- Schema::CONSTRAIN => null,
- Schema::PRIMARY_KEY => 'id',
- Schema::COLUMNS => [
- 'balance' => 'balance',
- 'currencyCode' => 'currency_code',
- 'id' => 'id',
- ],
- Schema::TYPECAST => [
- 'balance' => 'int',
- 'id' => 'int',
- ],
- Schema::RELATIONS => [],
- ],
- ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement