WrapperInterface.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. function getObject();
  18. /**
  19. * Extract property value from object
  20. *
  21. * @param string $property
  22. * @return mixed
  23. */
  24. function getPropertyValue($property);
  25. /**
  26. * Set the property
  27. *
  28. * @param string $property
  29. * @param mixed $value
  30. * @return \Gedmo\Tool\WrapperInterface
  31. */
  32. function setPropertyValue($property, $value);
  33. /**
  34. * Populates the object with given property values
  35. *
  36. * @param array $data
  37. * @return \Gedmo\Tool\WrapperInterface
  38. */
  39. function populate(array $data);
  40. /**
  41. * Checks if identifier is valid
  42. *
  43. * @return boolean
  44. */
  45. function hasValidIdentifier();
  46. /**
  47. * Get metadata
  48. *
  49. * @return object
  50. */
  51. function getMetadata();
  52. /**
  53. * Get the object identifier, $single or composite
  54. *
  55. * @param boolean $single
  56. * @return array|mixed
  57. */
  58. function getIdentifier($single = true);
  59. /**
  60. * Get root object class name
  61. *
  62. * @return string
  63. */
  64. function getRootObjectName();
  65. }