cycle / entity-macros
Provides a collection of attributes that add behaviors to Cycle ORM entities
Fund package maintenance!
1.8.0
2026-11-21 12:34 UTC
Requires
- php: >=8.2
- cycle/database: ^2.24
- cycle/orm: ^2.19
- cycle/schema-builder: ^2.13
- psr/container: ^1.1|^2.0
- psr/event-dispatcher: ^1
- yiisoft/injector: ^1.2
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.8
- buggregator/trap: ^1.20
- cycle/annotated: ^4.7
- cycle/testing: ^0.1.2
- llm/skills: ^1.20
- ramsey/uuid: ^4.9
- roxblnfk/unpoly: ^1.8
- spiral/tokenizer: ^3.18
- testo/testo: ^0.10.60
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Behavior attributes for Cycle ORM entities
The package provides a collection of attributes that add behaviors to Cycle ORM entities. It also provides a convenient API to create custom behavior attributes.
Get Started
Installation
composer require cycle/entity-behavior
Requires PHP 8.2+.
Configuration
After installation the package you need to create Cycle\ORM\ORM object with
passing \Cycle\ORM\Entity\Behavior\EventDrivenCommandGenerator generator object as third (commandGenerator)
argument.
Example
use Cycle\ORM\ORM; use Cycle\ORM\Entity\Behavior\EventDrivenCommandGenerator; // Application container (PSR-11 compatible). // https://www.php-fig.org/psr/psr-11/ $container = new Container(); $commandGenerator = new EventDrivenCommandGenerator($schema, $container); $orm = new ORM( factory: $factory, schema: $schema, commandGenerator: $commandGenerator, );
That's it. Now you can use all benefits of this package.