ClassMetadataFactory.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace Doctrine\Persistence\Mapping;
  3. /**
  4. * Contract for a Doctrine persistence layer ClassMetadata class to implement.
  5. */
  6. interface ClassMetadataFactory
  7. {
  8. /**
  9. * Forces the factory to load the metadata of all classes known to the underlying
  10. * mapping driver.
  11. *
  12. * @return ClassMetadata[] The ClassMetadata instances of all mapped classes.
  13. */
  14. public function getAllMetadata();
  15. /**
  16. * Gets the class metadata descriptor for a class.
  17. *
  18. * @param string $className The name of the class.
  19. *
  20. * @return ClassMetadata
  21. */
  22. public function getMetadataFor($className);
  23. /**
  24. * Checks whether the factory has the metadata for a class loaded already.
  25. *
  26. * @param string $className
  27. *
  28. * @return bool TRUE if the metadata of the class in question is already loaded, FALSE otherwise.
  29. */
  30. public function hasMetadataFor($className);
  31. /**
  32. * Sets the metadata descriptor for a specific class.
  33. *
  34. * @param string $className
  35. * @param ClassMetadata $class
  36. */
  37. public function setMetadataFor($className, $class);
  38. /**
  39. * Returns whether the class with the specified name should have its metadata loaded.
  40. * This is only the case if it is either mapped directly or as a MappedSuperclass.
  41. *
  42. * @param string $className
  43. *
  44. * @return bool
  45. */
  46. public function isTransient($className);
  47. }