哪个是用于 codeigniter 的最佳 PHP ORM?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22816018/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 16:17:22  来源:igfitidea点击:

Which is the best PHP ORM for codeigniter?

phpcodeigniterormframeworks

提问by Arun

Which would be the best ORM for the codeigniter framework. I saw some similar questions but it was too old and the link didn't work. Can anyone help me out with this?

这将是 codeigniter 框架的最佳 ORM。我看到了一些类似的问题,但它太旧了,链接不起作用。谁能帮我解决这个问题?

回答by Ijas Ameenudeen

DataMapper

数据映射器

An Object Relational Mapper written in PHP for CodeIgniter. It is designed to map your Database tables into easy to work with objects, fully aware of the relationships between each other.

用 PHP 为 CodeIgniter 编写的对象关系映射器。它旨在将您的数据库表映射到易于使用的对象中,充分了解彼此之间的关系。

Website: http://datamapper.wanwizard.eu/

网站:http: //datamapper.wanwizard.eu/

Gas ORM

气体 ORM

A lightweight and easy-to-use ORM for CodeIgniter. Gas was built specifically for CodeIgniter app. It uses CodeIgniter Database packages, a powerful DBAL which support numerous DB drivers. Gas ORM provide a set of methods that will map your database tables and its relationship, into accessible object.

用于 CodeIgniter 的轻量级且易于使用的 ORM。Gas 是专门为 CodeIgniter 应用程序构建的。它使用 CodeIgniter 数据库包,这是一个强大的 DBAL,支持众多数据库驱动程序。Gas ORM 提供了一组方法,将您的数据库表及其关系映射到可访问的对象中。

Website: http://gasorm-doc.taufanaditya.com/

网站:http: //gasorm-doc.taufanaditya.com/

Doctrine

教义

Website: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/

网站:http: //docs.doctrine-project.org/projects/doctrine-orm/en/latest/

NOTE: You must do some workaround to integrate this with CI, try here.

注意:您必须采取一些变通方法将其与 CI 集成,请在此处尝试。

EDIT: Doctrine, integrating with CodeIgniter(working URL). This might not work for all CodeIgniter versions and may require slight adjustments.

编辑:Doctrine,与 CodeIgniter(工作 URL)集成这可能不适用于所有 CodeIgniter 版本,可能需要稍作调整。

回答by korono89

I've used Doctrine a number of times with CI and I love it. As I understand it there are two different ways to integrate CI with it, you can either install it as a plugin or use hooks.

我已经多次将 Doctrine 与 CI 一起使用,我喜欢它。据我了解,有两种不同的方法可以将 CI 与其集成,您可以将其安装为插件或使用钩子。

Reference:

参考:

http://web.archive.org/web/20160126131627/http://www.phpandstuff.com/articles/codeigniter-doctrine-from-scratch-day-1-install-and-setup

http://web.archive.org/web/20160126131627/http://www.phpandstuff.com/articles/codeigniter-doctrine-from-scratch-day-1-install-and-setup

http://docs.doctrine-project.org/en/2.0.x/cookbook/integrating-with-codeigniter.html

http://docs.doctrine-project.org/en/2.0.x/cookbook/integrating-with-codeigniter.html