PHPackages                             cycle/entity-macros - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. cycle/entity-macros

ActiveLibrary[Database &amp; ORM](/categories/database)

cycle/entity-macros
===================

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

1.7.1(5mo ago)82876[5 issues](https://github.com/cycle/entity-behavior/issues)[1 PRs](https://github.com/cycle/entity-behavior/pulls)MITPHPPHP &gt;=8.0CI passing

Since Dec 22Pushed 5mo ago4 watchersCompare

[ Source](https://github.com/cycle/entity-behavior)[ Packagist](https://packagist.org/packages/cycle/entity-macros)[ Docs](https://cycle-orm.dev)[ GitHub Sponsors](https://github.com/sponsors/cycle)[ RSS](/packages/cycle-entity-macros/feed)WikiDiscussions 1.x Synced 1w ago

READMEChangelog (10)Dependencies (12)Versions (13)Used By (0)

Cycle ORM Entity Behavior
=========================

[](#cycle-orm-entity-behavior)

[![Latest Stable Version](https://camo.githubusercontent.com/9839a76b0a6d25343495f38162e94469331c38906322ff28e34256ab279bf773/68747470733a2f2f706f7365722e707567782e6f72672f6379636c652f656e746974792d6265686176696f722f76657273696f6e)](https://packagist.org/packages/cycle/entity-behavior)[![Build Status](https://github.com/cycle/entity-behavior/workflows/build/badge.svg)](https://github.com/cycle/entity-behavior/actions)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/cf13ccfd964484c093de153d518526987c5d86930d4d51c0ac2a6446d4b424ca/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6379636c652f656e746974792d6265686176696f722f6261646765732f7175616c6974792d73636f72652e706e673f623d312e78)](https://scrutinizer-ci.com/g/cycle/entity-behavior/?branch=1.x)[![Codecov](https://camo.githubusercontent.com/df025b8d56c0feaeafccf85991533b243b31ee17b3059978af40b9e521cb0bf9/68747470733a2f2f636f6465636f762e696f2f67682f6379636c652f656e746974792d6265686176696f722f67726170682f62616467652e737667)](https://codecov.io/gh/cycle/entity-behavior)[![](https://camo.githubusercontent.com/4442b73a11753b80fdd7b442ddbfaf8383902c8b9ffa66ed1718e8c62e102f2e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646973636f72642d636861742d6d6167656e74612e737667)](https://discord.gg/TFeEmCs)

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
------------

[](#installation)

The package is available via composer and can be installed using the following command:

```
composer require cycle/entity-behavior
```

Configuration
-------------

[](#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

[](#available-behaviors)

- [UUID](https://cycle-orm.dev/docs/entity-behaviors-uuid)
- [CreatedAt and UpdatedAt](https://cycle-orm.dev/docs/entity-behaviors-timestamps)
- [SoftDelete](https://cycle-orm.dev/docs/entity-behaviors-soft-delete)
- [OptimisticLock](https://cycle-orm.dev/docs/entity-behaviors-optimistic-lock)
- [Hook](https://cycle-orm.dev/docs/entity-behaviors-hooks)
- [EventListener](https://cycle-orm.dev/docs/entity-behaviors-event-listener)

License:
--------

[](#license)

The MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information. Maintained by [Spiral Scout](https://spiralscout.com).

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance57

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~130 days

Recently: every ~33 days

Total

12

Last Release

175d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/796136?v=4)[Anton Tsitou](/maintainers/wolfy-j)[@wolfy-j](https://github.com/wolfy-j)

---

Top Contributors

[![roxblnfk](https://avatars.githubusercontent.com/u/4152481?v=4)](https://github.com/roxblnfk "roxblnfk (31 commits)")[![msmakouz](https://avatars.githubusercontent.com/u/67324318?v=4)](https://github.com/msmakouz "msmakouz (19 commits)")[![puzzledpolymath](https://avatars.githubusercontent.com/u/162779269?v=4)](https://github.com/puzzledpolymath "puzzledpolymath (9 commits)")[![butschster](https://avatars.githubusercontent.com/u/773481?v=4)](https://github.com/butschster "butschster (2 commits)")[![norets](https://avatars.githubusercontent.com/u/3883595?v=4)](https://github.com/norets "norets (1 commits)")[![gam6itko](https://avatars.githubusercontent.com/u/3841197?v=4)](https://github.com/gam6itko "gam6itko (1 commits)")[![wpdmitry](https://avatars.githubusercontent.com/u/30390500?v=4)](https://github.com/wpdmitry "wpdmitry (1 commits)")

---

Tags

hacktoberfest

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/cycle-entity-macros/health.svg)

```
[![Health](https://phpackages.com/badges/cycle-entity-macros/health.svg)](https://phpackages.com/packages/cycle-entity-macros)
```

###  Alternatives

[cycle/orm

PHP DataMapper ORM and Data Modelling Engine

1.3k835.4k65](/packages/cycle-orm)[cycle/annotated

Cycle ORM Annotated Entities generator

28724.2k44](/packages/cycle-annotated)[yiisoft/yii-cycle

Cycle ORM v2 support

47115.1k](/packages/yiisoft-yii-cycle)[hyperf/database

A flexible database library.

202.8M257](/packages/hyperf-database)[spiral/cycle-bridge

Cycle ORM integration package

18128.9k7](/packages/spiral-cycle-bridge)[cycle/active-record

Provides a simple way to work with your database using Active Record pattern and Cycle ORM

671.3k3](/packages/cycle-active-record)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
