ClassMetadataFactory.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /*
  3. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  4. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  5. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  6. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  9. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  10. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  11. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  12. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  13. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. *
  15. * This software consists of voluntary contributions made by many individuals
  16. * and is licensed under the LGPL. For more information, see
  17. * <http://www.doctrine-project.org>.
  18. */
  19. namespace Doctrine\Common\Persistence\Mapping;
  20. /**
  21. * Contract for a Doctrine persistence layer ClassMetadata class to implement.
  22. *
  23. * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
  24. * @link www.doctrine-project.org
  25. * @since 2.1
  26. * @author Benjamin Eberlei <kontakt@beberlei.de>
  27. * @author Jonathan Wage <jonwage@gmail.com>
  28. */
  29. interface ClassMetadataFactory
  30. {
  31. /**
  32. * Forces the factory to load the metadata of all classes known to the underlying
  33. * mapping driver.
  34. *
  35. * @return array The ClassMetadata instances of all mapped classes.
  36. */
  37. function getAllMetadata();
  38. /**
  39. * Gets the class metadata descriptor for a class.
  40. *
  41. * @param string $className The name of the class.
  42. * @return ClassMetadata
  43. */
  44. function getMetadataFor($className);
  45. /**
  46. * Checks whether the factory has the metadata for a class loaded already.
  47. *
  48. * @param string $className
  49. * @return boolean TRUE if the metadata of the class in question is already loaded, FALSE otherwise.
  50. */
  51. function hasMetadataFor($className);
  52. /**
  53. * Sets the metadata descriptor for a specific class.
  54. *
  55. * @param string $className
  56. * @param ClassMetadata $class
  57. */
  58. function setMetadataFor($className, $class);
  59. /**
  60. * Whether the class with the specified name should have its metadata loaded.
  61. * This is only the case if it is either mapped directly or as a
  62. * MappedSuperclass.
  63. *
  64. * @param string $className
  65. * @return boolean
  66. */
  67. function isTransient($className);
  68. }