About

The Doctrine Project is the home of a selected set of PHP libraries primarily focused
on providing persistence services and related functionality. Its prize projects are a
Object Relational Mapper and the Database Abstraction Layer it is built on top of.
You can read more about what Doctrine has to offer below.

Common Shared Libraries

Doctrine Common contains some base functionality and interfaces you need
in order to create a Doctrine style object mapper. All of our mapper
projects follow the same Doctrine\Common\Persistence interfaces.
Here are the ObjectManager and ObjectRepository interfaces:

To implement a lexer just extend the
Doctrine\Common\Lexer\AbstractParser class and implement the
getCatchablePatterns, getNonCatchablePatterns, and getType
methods. Here is a very simple example lexer implementation named
CharacterTypeLexer. It tokenizes a string to T_UPPER,
T_LOWER and T_NUMER:

Doctrine MongoDB is a library that provides an abstraction layer on top
of the PHP MongoDB PECL extension. It provides some additional
functionality and abstractions to make working with MongoDB easier.

Object Mappers

The object mappers are where all the pieces come together. The object
mappers provide transparent persistence for PHP objects. As mentioned
above, they all implement the common interfaces from Doctrine\Common
so working with each of them is generally the same. You have an
ObjectManager to manage the persistent state of your domain objects:

<?php$user=newUser();$user->setId(1);$user->setUsername('jwage');$om=$this->getYourObjectManager();$om->persist($user);$om->flush();// insert the new document

Then you can find that object later and modify it:

<?php$user=$om->find('User',1);echo$user->getUsername();// prints "jwage"$user->setUsername('jonwge');// change the obj in memory$om->flush();// updates the object in the database