Doctrine

Doctrine项目是主要关注数据库存储和对象映射的几个PHP库的所在地。(The Doctrine Project is the home to several PHP libraries primarily focused on database storage and object mapping. )

Github星跟蹤圖

Doctrine项目是一系列主要集中于提供持久性服务和相关功能的一组PHP库的所在地。 其核心项目是一个对象关系映射器(ORM)和建立于其上的数据库抽象层(DBAL)。Doctrine从Hibernate ORM的概念中受益匪浅,并使它们适应了PHP语言。

其主要功能之一是在由Hibernate的HQL启发的、基于专有的面向对象的SQL术语中编写数据库查询(称为Doctrine查询语言(DQL))的选项。 这为开发人员提供了强大的SQL替代方法,可以保持灵活性,而不需要不必要的代码重复。

Doctrine 3是PHP 7.2+的对象关系映射器(ORM),它为PHP对象提供透明的持久性。

Doctrine是一个开源项目,根据MIT许可证免费提供。 它是由在业余时间免费工作的人建造的。

为何使用Doctrine?
  • 自2006年以来,非常稳定,高品质的代码库。
  • 非常灵活和强大的对象映射和查询功能。
  • 支持所有用例的高级和低级数据库编程。
  • 大型社区和许多不同框架的集成(Symfony,Zend Framework,CodeIgniter,Flow,Lithium等)

许多其他流行的PHP项目都使用Doctrine中的库。 有些使用完整的ORM,而其他人只能使用一个小型库,如Inflector。 Symfony、Drupal、Laravel、JMS Libraries、Go! AOP、KNP Labs、eZ Platform、API Platform、PrestaShop、PHPUnit、Prophecy、phpbench、TYPO3、Sonata Project、Akeneo PIM、Pimcore、Sylius 和其他很多项目都使用 了Doctrine。

主要指標

概覽
名稱與所有者doctrine/orm
主編程語言PHP
編程語言PHP (語言數: 2)
平台BSD, Linux, Mac, Windows
許可證MIT License
所有者活动
創建於2010-04-06 21:42:59
推送於2025-06-07 19:17:45
最后一次提交
發布數182
最新版本名稱3.3.3 (發布於 2025-05-02 19:55:44)
第一版名稱2.0.0-BETA1 (發布於 2010-04-27 20:35:58)
用户参与
星數10.1k
關注者數246
派生數2.5k
提交數14.9k
已啟用問題?
問題數6332
打開的問題數1255
拉請求數3579
打開的拉請求數37
關閉的拉請求數1701
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

Tidelift, Master, 2.8, 2.7, :----------------:, :----------:, :----------:, Build status, Build status, Build status, Coverage Status, Coverage Status, Coverage Status, ##### :warning: You are browsing the code of upcoming Doctrine 3.0.

Things changed a lot here and major code changes should be expected. If you are rather looking for a stable version, refer to the 2.7 branch for the current stable release or 2.8 branch for the upcoming release. If you are submitting a pull request, please see the Which branch should I choose? section below.

Doctrine 3 is an object-relational mapper (ORM) for PHP 7.2+ that provides transparent persistence
for PHP objects. It sits on top of a powerful database abstraction layer (DBAL). One of its key features
is the option to write database queries in a proprietary object oriented SQL dialect called Doctrine Query Language (DQL),
inspired by Hibernate's HQL. This provides developers with a powerful alternative to SQL that maintains flexibility
without requiring unnecessary code duplication.


Which branch should I choose?

Doctrine ORM for enterprise

Available as part of the Tidelift Subscription.

The maintainers of Doctrine ORM and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

More resources: