PHPackages                             ingenerator/kohana-doctrine2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. ingenerator/kohana-doctrine2

ActiveLibrary[Database &amp; ORM](/categories/database)

ingenerator/kohana-doctrine2
============================

Opinionated wrapper for the doctrine ORM

v3.1.0(11mo ago)630.0k↓16.2%11BSD-3-ClausePHPPHP ~8.2.0 || ~8.3.0 || ~8.4.0CI failing

Since Aug 19Pushed 11mo ago3 watchersCompare

[ Source](https://github.com/ingenerator/kohana-doctrine2)[ Packagist](https://packagist.org/packages/ingenerator/kohana-doctrine2)[ Docs](https://github.com/ingenerator/kohana-doctrine2)[ RSS](/packages/ingenerator-kohana-doctrine2/feed)WikiDiscussions 3.x Synced today

READMEChangelog (10)Dependencies (10)Versions (25)Used By (1)

kohana-doctrine2 - integrates [Doctrine 2 ORM](http://www.doctrine-project.org/projects/orm.html) with Kohana
=============================================================================================================

[](#kohana-doctrine2---integrates-doctrine-2-orm-with-kohana)

**\[!!\] This package has been significantly rewritten for the 0.2 series**

kohana-doctrine2 provides a wrapper with opinionated configuration for the Doctrine2 ORM in the way we like to use it. The package does not attempt to make every part of Doctrine2 available or configurable, though can usually be extended or configured to tweak behaviour.

In particular:

- Only PHP annotation entity mapping (with the SimpleAnnotationReader) is supported
- By default, you must specify an explicit list of entity classes rather than just paths to where there might be some
- By default, we just expose two cache instances - one for "compiler stuff" like class metadata and parsed DQL-&gt;SQL queries, and one for "data stuff" like query results. The compiler cache defaults to an ArrayCache in dev and an ApcuCache in other environments. The data cache is always an ArrayCache unless you specify something else.

Installation
------------

[](#installation)

Run `composer require ingenerator/kohana-doctrine2`. Note this is no longer a kohana module so you don't need to register it in the bootstrap, so long as you register Composer's autoloader.

Configuring database connection
-------------------------------

[](#configuring-database-connection)

We read database information from the Kohana::$config 'database' group, in the same structure as the legacy core Kohana database module. Currently we only support a MySQL backend with a pdo\_mysql driver in Doctrine.

Using the default Kohana config readers, your app should provide a `config/database.php` like this:

```
