Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/ormPublic

PHP DataMapper, ORM

License

NotificationsYou must be signed in to change notification settings

cycle/orm

Latest Stable VersionScrutinizer Code QualityCodecovDiscordMeta Storm Plugin

Cycle ORM

Cycle is PHP DataMapper, ORM and Data Modelling engine designed to safely work in classic and daemonized PHPapplications (likeRoadRunner). The ORM provides flexible configuration optionsto model datasets, powerful query builder and supports dynamic mapping schema. The engine can work with plain PHPobjects, 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 objectsorsame 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

ComponentCurrent Status
cycle/active-recordLicensePHPStable ReleaseTotal Downloads
cycle/schema-builderLicensePHPStable ReleaseTotal Downloads
cycle/schema-rendererLicensePHPStable ReleaseTotal Downloads
cycle/schema-providerLicensePHPStable ReleaseTotal Downloads
cycle/annotatedLicensePHPStable ReleaseTotal Downloads
cycle/migrationsLicensePHPStable ReleaseTotal Downloads
cycle/entity-behaviorLicensePHPStable ReleaseTotal Downloads
cycle/entity-behavior-uuidLicensePHPStable ReleaseTotal Downloads
cycle/databaseLicensePHPStable ReleaseTotal Downloads
cycle/schema-migrations-generatorLicensePHPStable ReleaseTotal Downloads
cycle/orm-promise-mapperLicensePHPStable ReleaseTotal 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 =newEntityManager($orm);foreach($usersas$user) {$em->persist($user);}$em->run();

License:

Cycle ORM is open-sourced software licensed under theMIT license.Maintained bySpiral Scout.

Sponsor this project

 

Contributors30

Languages


[8]ページ先頭

©2009-2025 Movatter.jp