Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spiral: Add Cycle ORM config #9034

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions frameworks/PHP/spiral/app/config/cycle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

declare(strict_types=1);

use Cycle\ORM\SchemaInterface;

return [
'schema' => [
/**
* true (Default) - Schema will be stored in a cache after compilation.
* It won't be changed after entity modification. Use `php app.php cycle` to update schema.
*
* false - Schema won't be stored in a cache after compilation.
* It will be automatically changed after entity modification. (Development mode)
*/
'cache' => true,

/**
* The CycleORM provides the ability to manage default settings for
* every schema with not defined segments
*/
'defaults' => [
SchemaInterface::MAPPER => \Cycle\ORM\Mapper\Mapper::class,
SchemaInterface::REPOSITORY => \Cycle\ORM\Select\Repository::class,
SchemaInterface::SCOPE => null,
SchemaInterface::TYPECAST_HANDLER => [
\Cycle\ORM\Parser\Typecast::class
],
],

'collections' => [
'default' => 'array',
'factories' => [
'array' => new \Cycle\ORM\Collection\ArrayCollectionFactory(),
// 'doctrine' => new \Cycle\ORM\Collection\DoctrineCollectionFactory(),
// 'illuminate' => new \Cycle\ORM\Collection\IlluminateCollectionFactory(),
],
],

/**
* Schema generators (Optional)
* null (default) - Will be used schema generators defined in bootloaders
*/
'generators' => null,
],

/**
* Prepare all internal ORM services (mappers, repositories, typecasters...)
*/
'warmup' => true,
];