2019년 4월2020년 6월2021년 9월2022년 11월2024년 2월2025년 5월2026년 7월
아티팩트Packagistcomposer require cycle/orm
README
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.
// 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.