Code Monkey home page Code Monkey logo

orm's Introduction

Cycle ORM

Latest Stable Version Build Status Scrutinizer Code Quality Codecov

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

  • ORM with has-one, has-many, many-through-many and polymorphic relations
  • Plain Old PHP objects, AR, Custom objects or same entity type for multiple repositories
  • eager and lazy loading, query builder with multiple fetch strategies
  • embedded entities, lazy/eager loaded embedded partials
  • runtime configuration with/without code-generation
  • column-to-field mapping, single table inheritance, value objects support
  • hackable: persist strategies, mappers, relations, transactions
  • works with directed graphs and cyclic graphs using command chains
  • designed to work in long-running applications: immutable service core, disposable UoW
  • supports MySQL, MariaDB, PostgresSQL, SQLServer, SQLite
  • schema scaffolding, introspection, migrations and debugging
  • supports global query scopes, UUIDs as PK, soft deletes, auto timestamps and macros
  • custom column types, FKs to non-primary columns
  • use with or without annotations, proxy classes, and auto-migrations
  • compatible with Doctrine Collections, Illuminate Collections and custom collections
  • compatible with Doctrine Annotations, PHP8 attributes

Extensions

Component Current Status
cycle/schema-builder Latest Stable Version Build Status Scrutinizer Code Quality Codecov
cycle/schema-renderer Latest Stable Version Build Status Scrutinizer Code Quality Codecov
cycle/annotated Latest Stable Version Build Status Scrutinizer Code Quality Codecov
cycle/migrations Latest Stable Version Build Status Scrutinizer Code Quality Codecov
cycle/entity-behavior Latest Stable Version Build Status Scrutinizer Code Quality Codecov
cycle/entity-behavior-uuid Latest Stable Version Build Status Scrutinizer Code Quality Codecov
cycle/database Latest Stable Version Build Status Scrutinizer Code Quality Codecov
cycle/schema-migrations-generator Latest Stable Version Build Status Scrutinizer Code Quality Codecov
cycle/orm-promise-mapper Latest 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.

orm's People

Contributors

albertborsos avatar alexndr-novikov avatar andrew-demb avatar butschster avatar chadsikorra avatar evgenybarinov avatar hustlahusky avatar mishfish avatar mrakolice avatar msmakouz avatar pine3ree avatar rauanmayemir avatar roxblnfk avatar rustamwin avatar serafimarts avatar stylecibot avatar thenotsoft avatar vjik avatar vladgorenkin avatar vvval avatar wolfy-j avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.