It’s been almost 3 years since we released Cycle 1.0, and since then our team has done a great job optimizing the product and adding killer new features.
We’re now super excited to announce the release of Cycle 2.0, the open-source, PHP DataMapper, ORM and Data Modelling engine designed to safely work in classic and daemonized PHP applications. Cycle ORM provides flexible configuration options to model datasets, a powerful query builder and supports dynamic mapping schema. The engine can work with plain PHP objects and support annotation declarations, as well as proxies via extensions.
As always, we love hearing from the community and we are doing our best to support all your requests. We would be thankful to see your feedback and stars on GitHub, Twitter, Discord, and Telegram.
Here are the major changes in Cycle 2.0.
Added composite keys support in entities and relations.
PK (primary key) scheme and relations (inner key and outer key) now support composite (multiple) keys.
‘Joined Table Inheritance’ and ‘Single Table Inheritance‘. Added an ability to manage the inheritance hierarchy.
Significantly redesigned mappers
The default mapper now creates proxy entities
Added ability to create proxy entities that allows lazy loading of relationships.
Mapper code is noticeably simplified – it’s easier to work with ORM.
We created a new Entities hydrator from the ground up. Now it works much faster and supports working with private class properties.
Added support for custom collections in ‘Has Many’ and ‘Many To Many’ relations
Typecasting moved to the mapper and became more flexible and customizable. Now you can customize the typecast rules and their handlers (Typecast Handler). Typecast Handler – provides a convenient method of converting entity property values to common data types.
Old Cycle\ORM\Transaction split into Entity Manager and Unit Of Work.
Added PHP v. 8.0+ support
Different optimizations and enhancements:
Migrator moved to cycle/migrations. Old cycle/migrations moved to cycle/schema-migrations-generator
Schema Renderer – a set of utilities for formatted output of a scheme to the console or php file. May be useful when debugging or caching a schema in a php file.
Entity Behavior - a collection of attributes that add behaviors to Cycle ORM entities. The package also provides a simple API to create custom behavior attributes. The package provides several useful behaviors out of the box: CreatedAt, UpdatedAt, SoftDelete, OptimisticLock and a few more specific behaviors. UUID behaviors uses ramsey uuid package. UUID provides in a separate package.
Earlier we made a large number of other changes, check them all in this article.
Thanks for reading! We would highly appreciate it if you join our communities and share your feedback on GitHub, Twitter, Discord, and Telegram.