Search by

cycle / entity-behavior

wolfy-j

Provides a collection of attributes that add behaviors to Cycle ORM entities

Package info

github.com/cycle/entity-behavior

Homepage

Chat

Documentation

pkg:composer/cycle/entity-behavior

Fund package maintenance!

cycle

Statistics

Installs: 516 179

Dependents: 31

Suggesters: 5

Stars: 8

Open Issues: 9

1.7.1 2025-11-24 07:12 UTC

This package is auto-updated.

Last update: 2026-11-19 21:38:51 UTC


README

CycleORM Logo

Behavior attributes for Cycle ORM entities

Documentation Sponsor Discord

Psalm Level Type Coverage Codecov


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

PHP Latest Version on Packagist License Total Downloads

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.

Available behaviors