PHPackages                             linio/doctrine-service-provider - 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. linio/doctrine-service-provider

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

linio/doctrine-service-provider
===============================

Doctrine DBAL and ORM service providers for Pimple 3.

0.3.0(5y ago)011.5k[2 PRs](https://github.com/LinioIT/doctrine-service-provider/pulls)BSD-3-ClausePHP &gt;=7.1

Since Aug 5Compare

[ Source](https://github.com/LinioIT/doctrine-service-provider)[ Packagist](https://packagist.org/packages/linio/doctrine-service-provider)[ RSS](/packages/linio-doctrine-service-provider/feed)WikiDiscussions Synced today

READMEChangelog (1)Dependencies (4)Versions (6)Used By (0)

Doctrine Service Provider
=========================

[](#doctrine-service-provider)

[![Latest Stable Version](https://camo.githubusercontent.com/f13e6172263d79dd0aca06854a9ece53f0a935efd7808a33f494bf0c021d655e/68747470733a2f2f706f7365722e707567782e6f72672f6c696e696f2f646f637472696e652d736572766963652d70726f76696465722f762f737461626c652e737667)](https://packagist.org/packages/linio/doctrine-service-provider) [![License](https://camo.githubusercontent.com/15258ba57172004f49b8f1d05ac986cba6b5d2174d9018de48a7424576496b01/68747470733a2f2f706f7365722e707567782e6f72672f6c696e696f2f646f637472696e652d736572766963652d70726f76696465722f6c6963656e73652e737667)](https://packagist.org/packages/linio/doctrine-service-provider) [![Build Status](https://camo.githubusercontent.com/6796230a2ed5200ff1a5db1d9bb6a132d9bce6ce9de567ff081f75a84db7081d/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f4c696e696f49542f646f637472696e652d736572766963652d70726f76696465722e706e67)](http://travis-ci.org/LinioIT/doctrine-service-provider) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/6ba334106a69314f0e3b50b0862a608f7be51b0b521e8843889fa96fb4763785/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4c696e696f49542f646f637472696e652d736572766963652d70726f76696465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/LinioIT/doctrine-service-provider/?branch=master)

This provider is a complete solution for using Doctrine in Pimple. You can use the full ORM or just the DBAL. This project began as a fork of the [dflydev/doctrine-orm-service-provider](https://packagist.org/packages/dflydev/doctrine-orm-service-provider), which itself is based heavily on both the core [Doctrine Service Provider](http://silex.sensiolabs.org/doc/providers/doctrine.html) and the work done by [@docteurklein](https://github.com/docteurklein) on the [docteurklein/silex-doctrine-service-providers](https://github.com/docteurklein/SilexServiceProviders) project.

Some inspiration was also taken from [Doctrine Bundle](https://github.com/doctrine/DoctrineBundle) and [Doctrine Bridge](https://github.com/symfony/symfony/tree/master/src/Symfony/Bridge/Doctrine).

Changelog
---------

[](#changelog)

- 05-03-2019
    - Updated PHP &gt;=7.1
    - Updated Doctrine cache types
- 20-01-2015
    - Implemented second level cache
    - Compatibility with Doctrine 2.5

Install
-------

[](#install)

The recommended way to install [through composer](http://getcomposer.org).

```
$ composer require linio/doctrine-service-provider

```

Tests
-----

[](#tests)

To run the test suite, you need install the dependencies via composer, then run PHPUnit.

```
$ composer install
$ composer test

```

Usage
-----

[](#usage)

To start, you just need to register the `OrmServiceProvider`. This provider expects two services to be registered, **dbs** and **dbs.event\_manager**. You can register those services yourself, or, use the included `DbalServiceProvider`.

In each of these examples an Entity Manager that is bound to the default database connection will be provided. It will be accessible via **orm.em**.

```
