cycle / entity-behavior
Provides a collection of attributes that add behaviors to Cycle ORM entities
Fund package maintenance!
cycle
Installs: 171 800
Dependents: 19
Suggesters: 1
Security: 0
Stars: 10
Watchers: 4
Forks: 5
Open Issues: 6
Requires
- php: >=8.0
- cycle/orm: ^2.7
- cycle/schema-builder: ^2.8
- psr/container: ^1.0|^2.0
- psr/event-dispatcher: ^1
- yiisoft/injector: ^1.0
Requires (Dev)
- cycle/annotated: ^3.0
- phpunit/phpunit: ^9.5
- ramsey/uuid: ^4.5
- spiral/tokenizer: ^2.8 || ^3.0
- vimeo/psalm: ^5.11
README
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.
Installation
The package is available via composer and can be installed using the following command:
composer require cycle/entity-behavior
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.
Available behaviors
License:
The MIT License (MIT). Please see LICENSE
for more information. Maintained
by Spiral Scout.