cycle/orm
Composer 安装命令:
composer require cycle/orm
包简介
PHP DataMapper ORM and Data Modelling Engine
README 文档
README
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
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:
Cycle ORM is open-sourced software licensed under the MIT license. Maintained by Spiral Scout.
cycle/orm 适用场景与选型建议
cycle/orm 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 899.53k 次下载、GitHub Stars 达 1.33k, 最近一次更新时间为 2019 年 02 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「orm」 「sql」 「mysql」 「sqlite」 「postgresql」 「mssql」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 cycle/orm 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cycle/orm 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 cycle/orm 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dibi is Database Abstraction Library for PHP
Kinikit - PHP Application development framework MVC component
PHP Database ORM for Symfony1. Do NOT use for new projects: please move to a newest Symfony release and Doctrine2
Query filtering in your frontend
Database/ORM-agnostic query construction helper
PeskyORM - annoying ORM that contains tons of exceptions and throws them when anything goes wrong
统计信息
- 总下载量: 899.53k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1332
- 点击次数: 29
- 依赖项目数: 80
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2019-02-19