cycle / orm
PHP DataMapper ORM and Data Modelling Engine
Fund package maintenance!
cycle
Installs: 538 080
Dependents: 67
Suggesters: 1
Security: 0
Stars: 1 229
Watchers: 28
Forks: 71
Open Issues: 82
Requires
- php: >=8.0
- ext-pdo: *
- cycle/database: ^2.8.1
- doctrine/instantiator: ^1.3.1 || ^2.0
- spiral/core: ^2.8 || ^3.0
Requires (Dev)
- doctrine/collections: ^1.6 || ^2.0
- illuminate/collections: ^8.0
- loophp/collection: ^6.0 || ^7.0
- mockery/mockery: ^1.1
- phpunit/phpunit: ^9.5
- ramsey/uuid: ^4.0
- spiral/tokenizer: ^2.8 || ^3.0
- symfony/var-dumper: ^5.2 || ^6.0 || ^7.0
- vimeo/psalm: 5.21
- 2.x-dev
- v2.9.0
- v2.8.0
- v2.7.1
- v2.7.0
- v2.6.1
- v2.6.0
- v2.5.0
- v2.4.0
- v2.3.4
- v2.3.3
- v2.3.2
- v2.3.1
- v2.3.0
- v2.2.2
- v2.2.1
- v2.2.0
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.2
- v2.0.1
- v2.0.0
- 1.x-dev
- v1.8.1
- v1.8.0
- v1.7.1
- v1.7.0
- v1.6.1
- v1.6.0
- v1.5.1
- v1.5
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.17
- v1.2.16
- v1.2.15
- v1.2.14
- v1.2.13
- v1.2.12
- v1.2.11
- v1.2.10
- v1.2.9
- v1.2.8
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.18
- v1.1.17
- v1.1.16
- v1.1.15
- v1.1.14
- v1.1.13
- v1.1.12
- v1.1.11
- v1.1.10
- v1.1.9
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- 0.3a
- 0.2a
- v0.1a
- dev-many-to-many-self-cyclic
- dev-bytea-column
- dev-hotfix/entity-proxy-constructor
This package is auto-updated.
Last update: 2024-10-29 08:27:16 UTC
README
Cycle is PHP DataMapper, ORM and Data Modelling engine designed to safely work in classic and demonized PHP applications (like RoadRunner). The ORM provides flexible configuration options to model datasets, powerful query builder and supports dynamic mapping schema. The engine can work with plain PHP objects, support annotation declarations, and proxies via extensions.
Website and Documentation | Comparison with Eloquent and Doctrine
Features
- ORM with has-one, has-many, many-through-many and polymorphic relations
- Plain Old PHP objects, AR, Custom objects or same entity type for multiple repositories
- eager and lazy loading, query builder with multiple fetch strategies
- embedded entities, lazy/eager loaded embedded partials
- runtime configuration with/without code-generation
- column-to-field mapping, single table inheritance, value objects support
- hackable: persist strategies, mappers, relations, transactions
- works with directed graphs and cyclic graphs using command chains
- designed to work in long-running applications: immutable service core, disposable UoW
- supports MySQL, MariaDB, PostgresSQL, SQLServer, SQLite
- schema scaffolding, introspection, migrations and debugging
- supports global query scopes, UUIDs as PK, soft deletes, auto timestamps and macros
- custom column types, FKs to non-primary columns
- use with or without annotations, proxy classes, and auto-migrations
- compatible with Doctrine Collections, Illuminate Collections and custom collections
- compatible with Doctrine Annotations, PHP8 attributes
Extensions
Example:
// load all active users and pre-load their paid orders sorted from newest to olders // the pre-load will be complete using LEFT JOIN $users = $orm->getRepository(User::class) ->select() ->where('active', true) ->load('orders', [ 'method' => Select::SINGLE_QUERY, 'load' => function($q) { $q->where('paid', true)->orderBy('timeCreated', 'DESC'); } ]) ->fetchAll(); $em = new EntityManager($orm); foreach($users as $user) { $em->persist($user); } $em->run();
License:
The MIT License (MIT). Please see LICENSE
for more information.
Maintained by Spiral Scout.