ObjectManagerAware.php 1021 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Doctrine\Persistence;
  3. use Doctrine\Persistence\Mapping\ClassMetadata;
  4. /**
  5. * Makes a Persistent Objects aware of its own object-manager.
  6. *
  7. * Using this interface the managing object manager and class metadata instances
  8. * are injected into the persistent object after construction. This allows
  9. * you to implement ActiveRecord functionality on top of the persistence-ignorance
  10. * that Doctrine propagates.
  11. *
  12. * Word of Warning: This is a very powerful hook to change how you can work with your domain models.
  13. * Using this hook will break the Single Responsibility Principle inside your Domain Objects
  14. * and increase the coupling of database and objects.
  15. *
  16. * Every ObjectManager has to implement this functionality itself.
  17. */
  18. interface ObjectManagerAware
  19. {
  20. /**
  21. * Injects responsible ObjectManager and the ClassMetadata into this persistent object.
  22. *
  23. * @return void
  24. */
  25. public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata);
  26. }