BackendInterface.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Eav\Model\Entity\Attribute\Backend;
  7. /**
  8. * Entity attribute backend interface
  9. *
  10. * Backend is responsible for saving the values of the attribute
  11. * and performing pre and post actions
  12. *
  13. */
  14. interface BackendInterface
  15. {
  16. /**
  17. * @return string
  18. */
  19. public function getTable();
  20. /**
  21. * @return bool
  22. */
  23. public function isStatic();
  24. /**
  25. * @return string
  26. */
  27. public function getType();
  28. /**
  29. * @return string
  30. */
  31. public function getEntityIdField();
  32. /**
  33. * @param int $valueId
  34. * @return $this
  35. */
  36. public function setValueId($valueId);
  37. /**
  38. * @return int
  39. */
  40. public function getValueId();
  41. /**
  42. * @param \Magento\Framework\DataObject $object
  43. * @return $this
  44. */
  45. public function afterLoad($object);
  46. /**
  47. * @param \Magento\Framework\DataObject $object
  48. * @return $this
  49. */
  50. public function beforeSave($object);
  51. /**
  52. * @param \Magento\Framework\DataObject $object
  53. * @return $this
  54. */
  55. public function afterSave($object);
  56. /**
  57. * @param \Magento\Framework\DataObject $object
  58. * @return $this
  59. */
  60. public function beforeDelete($object);
  61. /**
  62. * @param \Magento\Framework\DataObject $object
  63. * @return $this
  64. */
  65. public function afterDelete($object);
  66. /**
  67. * Get entity value id
  68. *
  69. * @param \Magento\Framework\DataObject $entity
  70. * @return int
  71. */
  72. public function getEntityValueId($entity);
  73. /**
  74. * Set entity value id
  75. *
  76. * @param \Magento\Framework\DataObject $entity
  77. * @param int $valueId
  78. * @return $this
  79. */
  80. public function setEntityValueId($entity, $valueId);
  81. /**
  82. * Whether an attribute is represented by a scalar value that can be stored in a generic way
  83. *
  84. * @return bool
  85. */
  86. public function isScalar();
  87. }