开发者

What ORM solutions are available for Kohana 3.1?

Kohana 3.0 used to have Sprig, Jelly, etc. alongside with its default ORM system. As far as I understand, Kohana 3.1 is not compatible with Sprig and Jelly and its default ORM is still in development. What to 开发者_Go百科use for ORM in Kohana 3.1 then?


Take a look at Leap ORM for Kohana. You can download it off github at https://github.com/spadefoot/kohana-orm-leap

This ORM is designed to work with Kohana 3.0.X, Kohana 3.1.X, and Kohana 3.2. It works with all major databases (including MySQL, MariaDB, PostgresSQL, MS SQL, DB2, Oracle, Firebird, and Sqlite) unlike the other Kohana ORMs that I have seen. Expanding the ORM is extremely easy whereas Kohana's default ORM cannot be adapted to work with such databases without a lot of work.

It is pretty well documented. Unlike other ORMs for Kohana that I have seen, it can handle composite primary keys and can use more than integers as primary keys (e.g. strings). It also give you the flexibility to switch the database driver from the standard PHP extensions to PDO using a simple config file.


You can find 3.1 modules at Github:

Jelly for 3.1 (unofficial fork, Banks and Jonathan Geiger have no time for development)

Sprig branch for 3.1


Have you checked out PHP ActiveRecord? It is an ActiveRecord style ORM with validations, realtionships, eager loading, etc.


I strongly suggest you to use: http://www.doctrine-project.org/projects/orm

I have used both the default ORM in Kohana 3.0 (should be similar to the one in 3.1) and the doctrine ORM in big projects.

Doctrine is great. Everything you wan't is there. Even for very special and tricky cases. If you use the default Kohana 3 ORM you will end up extending it because it is to simple.

The configuration part in Doctrine can be a little scary because there are a lot of options. In the long run it is really worth it though :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜