Doctrine Webinars

Posted on May 30, 2019 by Jonathan H. Wage

As mentioned in the Monetizing Open Source blog post, Doctrine will be regularly organizing online webinars hosted with Zoom. You can join from anywhere in the world with a laptop and an internet connection. We will have topics presented by Doctrine core team members and members of the community.

To get things started we have a few webinars scheduled for the next few months:

Don't see something that you are interested in? Suggest an event topic you would like to see and we will see what we can do. We will be publishing new events in the coming weeks so check back soon!

Monetizing Open Source

Posted on May 21, 2019 by Jonathan H. Wage

In our quest to make Doctrine financially sustainable, we have created Doctrine Company, LLC under which the team can conduct business. We've had a strong 10 years of open source success but we believe that in order for Doctrine to be truly sustainable and to last another decade, we need to diversify and monetize the project. It is our goal to be able to generate enough money through the project to fund full or part time work on the project. Below you will find details of some of our monetization efforts.


Patreon is a platform that allows open source maintainers, artists, creators, etc. to create relationships with their users and offer them benefits for becoming a patron.

If you would like to make a donation to the project, Patreon is the place to do it. Depending on the tier, we offer a few different benefits:

  • A mention on Twitter.
  • Your name and website link on the Doctrine website.
  • Priority responses to Stack Overflow or GitHub issues/PRs.
  • Placement on a Partners page on the Doctrine website, with your logo, link, and a paragraph advertising your company's services.

Become a Patreon of Doctrine today!


Under the Doctrine Company, we are providing consulting and training services to companies that use PHP. The services we offer are not limited to Doctrine itself. Our team specializes in producing high quality PHP. Whether you are starting a new project or modernizing a legacy application, we can help your team level up their skills with tools like the following:

  • Doctrine DBAL - Connect to your favorite RDBMS using Doctrine's database abstraction library.
  • Doctrine Database Migrations - Safely manage your database schema and keep it up to date.
  • Doctrine ORM - Represent your domain model cleanly with plain old PHP objects and ensure the integrity of your data.
  • PHP_CodeSniffer - Keep aesthetic debates out of your code reviews by adopting a coding standard and enforcing it in your build process. We can help integrate Doctrine's own coding standard into your project or help codify your own.
  • Psalm / PHPStan - Statically analyze your codebase and find bugs that would otherwise only be found at runtime in production.

If you are interested, take a look at our Consulting page or contact us at [email protected] for more information.


We will host regular monthly webinars using Zoom. Each month we will have different topics presented to you by members of the Doctrine Core team or greater PHP community. We already have some great topics lined up for the next few months:


Tidelift is a managed open source subscription service backed by creators and maintainers. Development teams get better maintained open source. Maintainers get paid.

We have partnered with Tidelift as a maintainer to guarantee a high level of maintenance for their customers. In return, Tidelift pays Doctrine maintainers a percentage of what the customer pays. Tidelift is attempting to create a marketplace of open source maintainers and customers with the goal of providing higher levels of confidence for commercial entities when using open source. This can sometimes be one of the biggest challenges for using open source in the corporate world. Tidelift is taking a unique approach to solving this problem and we are excited to be a part of it!

Carbon Ads

One of the most valuable assets we have besides software is our website and the traffic we receive every month. You may have noticed some subtle ad placements on our website. These text-based ads are provided by Carbon Ads which is an ad network optimized for reaching designers and developers. We understand ads can be annoying and we hope that our users understand the trade-off we've made by choosing to place ads on our website.


Finally, we are partnering with commercial entities and other projects that use Doctrine to cross promote each other. Through our partner network we hope to introduce our users to vetted services and offerings from which they can benefit. Thanks to our Partners for supporting Doctrine.

Migrations 2.0 Stable Released

Posted on January 9, 2019 by Jonathan H. Wage

Today we are very excited to announce the stable release of Doctrine Migrations 2.0. Almost 10 years ago on Mar 23, 2010, the first commit of the 1.0 codebase was created. The history of the Doctrine Migrations project actually even goes back further to the days of Doctrine1 ORM but this was before the days of GitHub, Composer, etc and I think some of that history has been lost. It is amazing to look back over the last decade at how much the PHP eco-system has changed. It makes us appreciate all the great tools we have, even with all their flaws.

What is in 2.0?

The 2.0 release should be a relatively easy upgrade for most people. The primary goal of the 2.0 release was to modernize the codebase according to Doctrine Coding Standards, PHPStan and all of the other standardized Doctrine project infrastructure that has evolved over the last few years. This will ensure the project is alive and relevant for another decade.

In addition to upgrading the infrastructure of the project, it came with a few new nice features:

You can view the full changelog in the release on GitHub.

This release contains 36 resolved issues with 71 pull requests coming from 18 different contributors. Thanks to the following people for their help with this release:

Phasing out Doctrine Common & release of DBAL 2.8 and ORM 2.6.2

Posted on July 12, 2018 by Michael Moravec

Common 2.9 and phasing out the package

As another step in the ongoing effort to eliminate doctrine/common, there are now three new separate Doctrine packages:

This release introduces the following deprecations:

  • Doctrine\Common\Proxy component is deprecated, use ocramius/proxy-manager instead;
  • Doctrine\Common\Util\Debug is deprecated, use symfony/var-dumper instead;
  • Doctrine\Common\Lexer is deprecated, use Doctrine\Common\Lexer\AbstractLexer from doctrine/lexer or migrate to hoa/compiler instead;
  • Doctrine\Common\Util\Inflector is deprecated, use Doctrine\Common\Inflector\Inflector from doctrine/inflector instead;
  • Doctrine\Common\Util\ClassUtils is deprecated without replacement;
  • Doctrine\Common\Version is deprecated, refrain from checking Common version at runtime;
  • Doctrine\Common\CommonException is deprecated without replacement.

In addition to that, there will be no doctrine/common 3.0 and the package will be gradually phased out.

Version 2.x will be maintained at least until ORM 3.0 is released, ensuring compatibility with the latest PHP and providing bugfixes, but it will no longer ship any new features.

For complete release notes, visit GitHub.

DBAL 2.8.0

DBAL 2.8.0 is a minor release of Doctrine DBAL that aggregates over 30 fixes and improvements developed over the last 3 months.

The dependency on doctrine/common is removed. DBAL now depends on doctrine/cache and doctrine/event-manager instead.

For complete release notes, visit GitHub.

ORM 2.6.2

ORM 2.6.2 comes as a regular bugfix release.

It no longer uses the long ago deprecated Lexer and Inflector from doctrine/common.

For complete release notes, visit GitHub.

New Website

Posted on April 6, 2018 by Jonathan H. Wage

In 2007 Doctrine got its first official website at Before that, the website was an instance of Trac which also served as our documentation, issue tracker and project management tool.

The new website design was created by Phu Son Nguyen who worked at Yahoo! at the time. It was a huge step forward for the Doctrine Project and it gave us 10 solid years!

Fast-forward and today we are happy to be launching a new foundation for our website and documentation. In addition to the new look, here are some new features:

  • GitHub Edit links on all documentation pages to make it easy to contribute fixes when you come across something that could be improved.
  • Automated deploys with GitHub Pages. Simply create a pull request and it will be deployed to Merges to master automatically deploy to
  • Search powered by Algolia.
  • Mobile friendly.
  • Documentation supports multiple versions.
  • Documentation user experience improvements.

We hope that this helps improve the experience and make it easier to contribute. The code for the site is open source and can be found here. If you want to contribute to the documentation for a project, you can find the docs in a folder named /docs in the root of the project repository. Here is the ORM for example.

If you discover any issues, please report them on the GitHub Issue tracker for the project.

Doctrine ORM 2.6 and Next (3.0)

Posted on December 21, 2017 by Mike Simonson

We are happy to announce the immediate availability of Doctrine ORM 2.6.0.

ORM 2.6.0

This release contains almost 3 years of active development and it provides several improvements and fixes, including:

  • Better commit order calculation
  • More stable second level cache
  • Strict testing and quality control
  • PHP 7.1+ requirement



This release marks the feature freeze of the 2.x version.

If you need to improve please work on the develop branch that will become the 3.0 branch in the coming days. The changes are already too numerous to easily rebase a feature from the 2.x branch to the develop one.

Doctrine MongoDB ODM 1.2.0 and 1.1.7 Released

Posted on October 24, 2017 by Andreas Braun

We are happy to announce the immediate availability of Doctrine MongoDB ODM 1.2.0 and 1.1.7.

MongoDB ODM 1.1.7

Notable fixes may be found in the changelog. A full list of issues and pull requests included in this release may be found in the 1.1.7 milestone.

What is new in 1.2.0?

Doctrine MongoDB ODM 1.2.0 introduces the following new features:

  • The readOnly mapping option allows you to map immutable documents.
  • With slaveOkay being deprecated, you can now specify a readPreference for your documents. This readPreference will automatically be applied to all queries for those mapped documents.
  • With dbRef only offering limited support in aggregation pipeline queries, there's a new reference storage strategy called ref that stores references as objects (without "\$"-prefixed field names), allowing you to use it with discriminators and aggregation pipeline queries.
  • When mapping inverse references, you may now specify fields that will be primed when the reference is resolved. This saves you from writing a dedicated repository method for the sole purpose of priming references.
  • The odm:schema:validate command validates the document mapping to help you spot mistakes.
  • A new builder for aggregation pipeline queries, including support for marshalling results into read-only documents.
  • Query result documents that can be used to hydrate results from an aggregation pipeline query. These documents cannot be written back to the database.

Upgrading to 1.2.0

The new version requires PHP 5.6. Running on PHP 7+ requires the use of a polyfill for the legacy driver, e.g. mongo-php-adapter. When running on PHP 5.6, MongoDB ODM requires version 1.6.7 or newer of the legacy MongoDB driver.

Several features have been deprecated in this release and will be dropped in the 2.0 release. To see this, please view the UPGRADE document.


You can install the new version of MongoDB ODM by using Composer and the following composer.json contents:

    "require": {
        "doctrine/mongodb-odm": "^1.2.0"

Stability and upcoming releases

As of today, Doctrine MongoDB ODM 1.2.0 is the stable distribution. There is no release schedule for an upcoming version yet.

1.1.7 is the last release of the 1.1.x development line and will no longer receive bug fixes. Instead, we will focus on developing MongoDB ODM 2.0 with native support for the new MongoDB driver. This release will require at least PHP 7.1 and contain several BC breaking changes. To ease the migration process, we will release a 1.3.0 which will be backwards compatible to the 1.2.x line and only deprecate features to be removed in 2.0. The 1.x line of MongoDB ODM will not receive any new features.

PHP 7.1 requirement for Doctrine packages

Posted on July 25, 2017 by Andreas Braun

A few days ago, the Doctrine team released new versions of many packages, dropping support for PHP 5.6 and 7.0, as well as HHVM. The affected packages are:

  • doctrine/common 2.8.0
  • doctrine/dbal 2.6.0
  • doctrine/collections 1.5.0
  • doctrine/inflector 1.2.0
  • doctrine/cache 1.7.0
  • doctrine/instantiator 1.1.0
  • doctrine/annotations 1.5.0

Since many people are encountering issues with these updates, here are a few suggestions to ensure your code continues working as usual.

Composer version constraints

Chances are your version constraints in composer.json look something like this:

    "require": {
        "doctrine/orm": "^2.5"

The ^2.5 constraint resolves to: >= 2.5.0 && <= 2.999999.999999. This is intended: our projects all follow Semantic Versioning, so you can safely install a new minor version without having to fear BC breaks.

When determining what version to install, composer employs a SAT solver to make sure all dependencies are fulfilled. In our example above, the SAT solver finds a version newer than 2.5 that satisfies all requirements.

Making sure you get a compatible version

When you run composer update the next time, you'll automatically receive updates for the packages mentioned above, provided that you are running on PHP 7.1. If you are running an older PHP version, composer will not install a version that requires PHP 7.1, since its requirements are not fulfilled.

A common problem is people running a newer PHP version on their developer machines than on their production servers. In this case, running composer update on a developer machine (with PHP 7.1) might happily pull in an update that simply won't work when deployed on a production machine running PHP 5.6.

To make sure this doesn't happen to you, there are two choices:

  • run composer update on a machine with the same PHP version that you use in production
  • use the platform.config config setting in composer.json to override your local PHP version.

Why dropping PHP support in a minor version is not a BC break

One question we frequently hear is, "isn't dropping support for a PHP version a BC break"? In a nutshell, no. A BC break happens when there is an incompatible change that your package manager can't handle. For example, changing a method signature in a minor version is a no-go, since the composer version constraints mentioned above assume any minor upgrade can safely be used.

However, when we drop support for an older version of PHP, composer will not consider the new version if the PHP version requirement is no longer fulfilled. Thus, you won't end up with a fatal error due to a wrong method signature, you just won't get the new version.

Doctrine MongoDB 1.4.0

Posted on November 22, 2016 by Andreas Braun

We are happy to announce the immediate availability of Doctrine MongoDB Abstraction Layer 1.4.0.

Passing context options to the driver

With this release it's possible to pass driver options to the connection class, which will then be passed on to the MongoDB driver. For example, to pass a stream context with SSL context options, you could use the following code snippet:

$context = stream_context_create([
    'ssl' => [
        'allow_self_signed' => false,
$connection = new \Doctrine\MongoDB\Connection(null, [], null, null, ['context' => $context]);

Passing multiple expressions to logical operators

The addAnd, addNor and addOr methods in the query and aggregation builders now take multiple expression objects. Instead of having to call the method repeatedly, you may call it once with multiple arguments:

// Before

// After
$builder->addAnd($someExpression, $otherExpression);


The update and multiple methods in the query have been deprecated in favor of updateOne and updateMany. These deprecations help people using ODM prepare for the next version of ODM which will utilize the new MongoDB library API.

Bug fixes in this release

Notable fixes may be found in the changelog. A full list of issues and pull requests included in this release may be found in the 1.4.0 milestone.

PHP version support

With this release, we have dropped support for PHP 5.5. Users using PHP 5.5 or older are encouraged to upgrade to a newer PHP version. If you are using PHP 7.0 or 7.1, you can use this library by adding a polyfill for ext-mongo, like mongo-php-adapter.

Future releases

This release is the last planned minor release of the MongoDB Abstraction Layer, with only bugfixes being done in maintenance releases. The library will not be rewritten to support the new MongoDB driver. Users are encouraged to use the new MongoDB library. Doctrine MongoDB ODM will be adapted to support the new driver and the MongoDB library.


You can install the latest version using the following composer.json definitions:

    "require": {
        "doctrine/mongodb": "^1.4.0"

Doctrine MongoDB ODM 1.1.2 and 1.0.8 released

Posted on October 7, 2016 by Andreas Braun

We are happy to announce the immediate availability of Doctrine MongoDB ODM 1.1.2 and 1.0.8.

MongoDB ODM 1.0.8

  • calling dropCollections() in the SchemaManager did not drop GridFS collections. #1468
  • calling clear() on an uninitialized collection with orphanRemoval enabled failed to remove orphaned documents. #1500 - Documents with identifiers evaluating to false (e.g. empty string or 0) could not be reference using createDBRef() in DocumentManager. #1503

MongoDB ODM 1.1.2

  • This release contains the bugfixes outlined for ODM 1.0.8 above

  • Querying for referenced objects in findBy() or findOneBy() did not work properly due to incorrect preparation of the DBRef objects. #1481


You can install the latest version using the following composer.json definitions:

    "require": {
        "doctrine/mongodb-odm": "^1.1.2"

Support for Doctrine ODM 1.0.x

As outlined previously, support for MongoDB ODM 1.0.x will end on December 9th, 2016. If you have not upgraded to version 1.1 yet, please do so to receive future bug fixes.

View Blog Archive