Stars: 1160
Forks: 88
Pull Requests: 197
Issues: 208
Watchers: 29
Last Updated: 2023-09-13 14:40:38
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.
Website and Documentation | Comparison with Eloquent and Doctrine
// 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();
The MIT License (MIT). Please see LICENSE
for more information.
Maintained by Spiral Scout.