WrapperInterface.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. namespace Gedmo\Tool;
  3. /**
  4. * Object wrapper interface
  5. *
  6. * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
  7. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  8. */
  9. interface WrapperInterface
  10. {
  11. /**
  12. * Get currently wrapped object
  13. * etc.: entity, document
  14. *
  15. * @return object
  16. */
  17. public function getObject();
  18. /**
  19. * Extract property value from object
  20. *
  21. * @param string $property
  22. *
  23. * @return mixed
  24. */
  25. public function getPropertyValue($property);
  26. /**
  27. * Set the property
  28. *
  29. * @param string $property
  30. * @param mixed $value
  31. *
  32. * @return \Gedmo\Tool\WrapperInterface
  33. */
  34. public function setPropertyValue($property, $value);
  35. /**
  36. * Populates the object with given property values
  37. *
  38. * @param array $data
  39. *
  40. * @return static
  41. */
  42. public function populate(array $data);
  43. /**
  44. * Checks if identifier is valid
  45. *
  46. * @return boolean
  47. */
  48. public function hasValidIdentifier();
  49. /**
  50. * Get metadata
  51. *
  52. * @return object
  53. */
  54. public function getMetadata();
  55. /**
  56. * Get the object identifier, single or composite
  57. *
  58. * @param boolean $single
  59. *
  60. * @return array|mixed
  61. */
  62. public function getIdentifier($single = true);
  63. /**
  64. * Get root object class name
  65. *
  66. * @return string
  67. */
  68. public function getRootObjectName();
  69. /**
  70. * Chechks if association is embedded
  71. *
  72. * @param string $field
  73. *
  74. * @return bool
  75. */
  76. public function isEmbeddedAssociation($field);
  77. }