PHPackages                             componenta/cycle - 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. componenta/cycle

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

componenta/cycle
================

Cycle ORM integration for Componenta

v1.0.0(1mo ago)061MITPHPPHP ^8.4

Since Jun 21Pushed 1mo agoCompare

[ Source](https://github.com/componenta/cycle)[ Packagist](https://packagist.org/packages/componenta/cycle)[ RSS](/packages/componenta-cycle/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (12)Versions (2)Used By (1)

Componenta Cycle
================

[](#componenta-cycle)

Runtime integration between Componenta framework libraries and Cycle ORM/DBAL. The package provides repository base classes, data fetcher helpers, query filter contracts, typecasts, config provider factories, and database-oriented read models.

Discovery and console integration live in `componenta/cycle-app`.

Installation
------------

[](#installation)

```
composer require componenta/cycle
```

Install `componenta/cycle-app` only when an application needs entity discovery, schema-related console commands, or framework cache integration.

Related Packages
----------------

[](#related-packages)

PackageWhy it matters here`cycle/orm` and `cycle/database`Provide the ORM/DBAL layer; this package adds Componenta integration around them.`componenta/di`Registers repositories, factories, and typecast services.`componenta/cqrs`Commonly uses repositories in command handlers and data fetchers in query handlers.`componenta/paginator`Represents paginated read-side results.`componenta/cycle-app`Discovers entities, builds ORM configuration, and wires console commands.Repository Layer
----------------

[](#repository-layer)

`Repository` extends Cycle ORM repositories and gives application repositories a common framework base without forcing domain code to depend on the application runtime.

Use repositories for aggregate persistence and identity-based lookups. Keep business transitions in aggregates and handlers; repositories should not become policy or workflow services.

Data Fetchers
-------------

[](#data-fetchers)

`DataFetcher` is a read-side helper for list/detail projections built on Cycle DBAL. It provides:

- table name derivation with override support
- column selection through query interfaces
- pagination and optional total counts
- sort filters
- field mapping from `snake_case` to `camelCase`
- per-field casters
- mapper methods named as `map{FieldName}`
- batch relation helpers for belongs-to, has-many, and many-to-many reads

Fetcher methods transform database rows into arrays or projection objects. Relation loading is batched after rows are collected, so fetchers can avoid N+1 queries.

Query Contracts
---------------

[](#query-contracts)

Read query objects can opt into behavior by implementing small contracts:

ContractEnables`PaginableInterface`Limit/offset pagination.`RequiresTotalCountInterface`Exact total count calculation.`SortableInterface`Ordered reads.`SelectableInterface`Explicit selected columns.`SearchableInterface`Full-text-like filtering through a fetcher-defined search filter.`DateRangeInterface`Date interval filtering.`ListQueryInterface`Common marker for list query objects.The fetcher applies only the behavior requested by the query object. Infinite-scroll reads can avoid total-count queries by omitting `RequiresTotalCountInterface`.

Fetcher Extension Points
------------------------

[](#fetcher-extension-points)

Application fetchers usually extend `DataFetcher` and customize it with protected properties and methods:

APIPurpose`$excluded`Fields removed from the transformed result.`$autoMapToCamelCase`Enables automatic `snake_case` to `camelCase` result keys.`$fieldMapping`Explicit database-field to result-field map.`$casters`Field-to-caster map resolved through `CasterProviderInterface`.`map{FieldName}()`Per-field mapper method called after caster conversion.`loadRelations()`Optional relation-loading hook for batched belongs-to, has-many, and many-to-many reads.Standard filters include `PaginationFilter`, `OrderFilter`, `SearchFilter`, `DateRangeFilter`, `DateTimeFilter`, `ComparisonFilter`, `BetweenFilter`, `InFilter`, `NotInFilter`, `NullFilter`, `NotNullFilter`, `BooleanFilter`, and `SoftDeleteFilter`.

Typecasts And Factories
-----------------------

[](#typecasts-and-factories)

The package includes framework typecasts and factory services used to configure Cycle ORM integration. These are runtime pieces and can be wired manually or through the Componenta DI config provider.

Built-in typecasts are `UuidTypecast`, `EnumTypecast`, and `CarbonTypecast`.

`ConfigProvider` registers Cycle DBAL/ORM factories for database configuration, database manager, ORM, schema, entity manager, migrations, and the default core factory. The main config keys live in `ConfigKey`.

Performance Notes
-----------------

[](#performance-notes)

`DataFetcher` caches mapper-method resolution per instance, caches requested relation sets in a `WeakMap`, and uses single-query window counts when it is safe. When joins may duplicate rows, it falls back to a separate distinct count to preserve paginator correctness.

Boundaries
----------

[](#boundaries)

`componenta/cycle` contains runtime database behavior. Filesystem scanning, attribute discovery, schema console commands, and compile integration belong to `componenta/cycle-app`.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance92

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Unknown

Total

1

Last Release

39d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20490712?v=4)[Andrey Shelamkoff](/maintainers/Shelamkoff)[@Shelamkoff](https://github.com/Shelamkoff)

---

Top Contributors

[![Shelamkoff](https://avatars.githubusercontent.com/u/20490712?v=4)](https://github.com/Shelamkoff "Shelamkoff (2 commits)")

### Embed Badge

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

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

###  Alternatives

[cycle/annotated

Cycle ORM Annotated Entities generator

29793.3k56](/packages/cycle-annotated)[cycle/orm

PHP DataMapper ORM and Data Modelling Engine

1.3k922.8k85](/packages/cycle-orm)[wayofdev/laravel-cycle-orm-adapter

🔥 A Laravel adapter for CycleORM, providing seamless integration of the Cycle DataMapper ORM for advanced database handling and object mapping in PHP applications.

3535.8k3](/packages/wayofdev-laravel-cycle-orm-adapter)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[api-platform/state

API Platform state interfaces

294.9M137](/packages/api-platform-state)[cycle/active-record

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

671.7k5](/packages/cycle-active-record)

PHPackages © 2026

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