The Principal Dev – Masterclass for Tech Leads

The Principal Dev – Masterclass for Tech LeadsJuly 17-18

Join

Cycle ORM

Latest Stable Version Scrutinizer Code Quality Codecov Discord Meta Storm Plugin

Cycle ORM

Cycle is PHP DataMapper, ORM and Data Modelling engine designed to safely work in classic and daemonized PHP applications (like RoadRunner). The ORM provides flexible configuration options to model datasets, powerful query builder and supports dynamic mapping schema. The engine can work with plain PHP objects, support annotation declarations, and proxies via extensions.

Website and Documentation | Comparison with Eloquent and Doctrine

Features

Extensions

Component Current Status
cycle/active-record License PHP Stable Release Total Downloads
cycle/schema-builder License PHP Stable Release Total Downloads
cycle/schema-renderer License PHP Stable Release Total Downloads
cycle/schema-provider License PHP Stable Release Total Downloads
cycle/annotated License PHP Stable Release Total Downloads
cycle/migrations License PHP Stable Release Total Downloads
cycle/entity-behavior License PHP Stable Release Total Downloads
cycle/entity-behavior-uuid License PHP Stable Release Total Downloads
cycle/database License PHP Stable Release Total Downloads
cycle/schema-migrations-generator License PHP Stable Release Total Downloads
cycle/orm-promise-mapper License PHP Stable Release Total Downloads

Example:

// load all active users and pre-load their paid orders sorted from newest to olders
// the pre-load will be complete using LEFT JOIN
$users = $orm->getRepository(User::class)
    ->select()
    ->where('active', true)
    ->load('orders', [
        'method' => Select::SINGLE_QUERY,
        'load'   => function($q) {
            $q->where('paid', true)->orderBy('timeCreated', 'DESC');
        }
    ])
    ->fetchAll();

$em = new EntityManager($orm);

foreach($users as $user) {
    $em->persist($user);
}

$em->run();

License:

Cycle ORM is open-sourced software licensed under the MIT license. Maintained by Spiral Scout.

Join libs.tech

...and unlock some superpowers

GitHub

We won't share your data with anyone else.