cycle.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. declare(strict_types=1);
  3. use Cycle\ORM\SchemaInterface;
  4. /** @see \Spiral\Cycle\Config\CycleConfig */
  5. return [
  6. 'schema' => [
  7. /**
  8. * true (Default) - Schema will be stored in a cache after compilation.
  9. * It won't be changed after entity modification. Use `php app.php cycle` to update schema.
  10. *
  11. * false - Schema won't be stored in a cache after compilation.
  12. * It will be automatically changed after entity modification. (Development mode)
  13. */
  14. 'cache' => true,
  15. /**
  16. * The CycleORM provides the ability to manage default settings for
  17. * every schema with not defined segments
  18. */
  19. 'defaults' => [
  20. SchemaInterface::MAPPER => \Cycle\ORM\Mapper\Mapper::class,
  21. SchemaInterface::REPOSITORY => \Cycle\ORM\Select\Repository::class,
  22. SchemaInterface::SCOPE => null,
  23. SchemaInterface::TYPECAST_HANDLER => [
  24. \Cycle\ORM\Parser\Typecast::class
  25. ],
  26. ],
  27. 'collections' => [
  28. 'default' => 'array',
  29. 'factories' => [
  30. 'array' => new \Cycle\ORM\Collection\ArrayCollectionFactory(),
  31. // 'doctrine' => new \Cycle\ORM\Collection\DoctrineCollectionFactory(),
  32. // 'illuminate' => new \Cycle\ORM\Collection\IlluminateCollectionFactory(),
  33. ],
  34. ],
  35. /**
  36. * Schema generators (Optional)
  37. * null (default) - Will be used schema generators defined in bootloaders
  38. */
  39. 'generators' => null,
  40. ],
  41. /**
  42. * Prepare all internal ORM services (mappers, repositories, typecasters...)
  43. */
  44. 'warmup' => \env('RR_MODE') !== null,
  45. ];