Chris@0: . Chris@0: */ Chris@0: Chris@0: namespace Doctrine\Common\Persistence; Chris@0: Chris@0: use Doctrine\Common\Persistence\Mapping\ClassMetadata; Chris@0: Chris@0: /** Chris@0: * Makes a Persistent Objects aware of its own object-manager. Chris@0: * Chris@0: * Using this interface the managing object manager and class metadata instances Chris@0: * are injected into the persistent object after construction. This allows Chris@0: * you to implement ActiveRecord functionality on top of the persistence-ignorance Chris@0: * that Doctrine propagates. Chris@0: * Chris@0: * Word of Warning: This is a very powerful hook to change how you can work with your domain models. Chris@0: * Using this hook will break the Single Responsibility Principle inside your Domain Objects Chris@0: * and increase the coupling of database and objects. Chris@0: * Chris@0: * Every ObjectManager has to implement this functionality itself. Chris@0: * Chris@0: * @author Benjamin Eberlei Chris@0: */ Chris@0: interface ObjectManagerAware Chris@0: { Chris@0: /** Chris@0: * Injects responsible ObjectManager and the ClassMetadata into this persistent object. Chris@0: * Chris@0: * @param ObjectManager $objectManager Chris@0: * @param ClassMetadata $classMetadata Chris@0: * Chris@0: * @return void Chris@0: */ Chris@0: public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata); Chris@0: }