Home

Awesome

Cycle ORM

Latest Stable Version Build Status Scrutinizer Code Quality Codecov <a href="https://discord.gg/TFeEmCs"><img src="https://img.shields.io/badge/discord-chat-magenta.svg"></a>

<img src="https://cycle-orm.dev/cycle.png" height="135px" alt="Cycle ORM" align="left"/>

Cycle is PHP DataMapper, ORM and Data Modelling engine designed to safely work in classic and demonized 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.

<p align="center"> <a href="https://cycle-orm.dev/docs"><b>Website and Documentation</b></a> | <a href="https://github.com/cycle/docs/issues/3">Comparison with Eloquent and Doctrine</a> </p>

Features

Extensions

ComponentCurrent Status
cycle/schema-builderLatest Stable Version Build Status Scrutinizer Code Quality Codecov
cycle/schema-rendererLatest Stable Version Build Status Scrutinizer Code Quality Codecov
cycle/annotatedLatest Stable Version Build Status Scrutinizer Code Quality Codecov
cycle/migrationsLatest Stable Version Build Status Scrutinizer Code Quality Codecov
cycle/entity-behaviorLatest Stable Version Build Status Scrutinizer Code Quality Codecov
cycle/entity-behavior-uuidLatest Stable Version Build Status Scrutinizer Code Quality Codecov
cycle/databaseLatest Stable Version Build Status Scrutinizer Code Quality Codecov
cycle/schema-migrations-generatorLatest Stable Version Build Status Scrutinizer Code Quality Codecov
cycle/orm-promise-mapperLatest Stable Version Build Status Scrutinizer Code Quality Codecov

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:

The MIT License (MIT). Please see LICENSE for more information. Maintained by Spiral Scout.