WrapperInterface.php 1.5KB

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