AttributeRepositoryInterface.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Eav\Api;
  8. /**
  9. * Interface AttributeRepositoryInterface
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface AttributeRepositoryInterface
  14. {
  15. /**
  16. * Retrieve all attributes for entity type
  17. *
  18. * @param string $entityTypeCode
  19. * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
  20. * @return \Magento\Eav\Api\Data\AttributeSearchResultsInterface
  21. */
  22. public function getList($entityTypeCode, \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria);
  23. /**
  24. * Retrieve specific attribute
  25. *
  26. * @param string $entityTypeCode
  27. * @param string $attributeCode
  28. * @return \Magento\Eav\Api\Data\AttributeInterface
  29. * @throws \Magento\Framework\Exception\NoSuchEntityException
  30. */
  31. public function get($entityTypeCode, $attributeCode);
  32. /**
  33. * Create attribute data
  34. *
  35. * @param \Magento\Eav\Api\Data\AttributeInterface $attribute
  36. * @return string
  37. * @throws \Magento\Framework\Exception\StateException
  38. */
  39. public function save(\Magento\Eav\Api\Data\AttributeInterface $attribute);
  40. /**
  41. * Delete Attribute
  42. *
  43. * @param Data\AttributeInterface $attribute
  44. * @return bool True if the entity was deleted
  45. * @throws \Magento\Framework\Exception\StateException
  46. */
  47. public function delete(Data\AttributeInterface $attribute);
  48. /**
  49. * Delete Attribute By Id
  50. *
  51. * @param int $attributeId
  52. * @return bool True if the entity was deleted
  53. * @throws \Magento\Framework\Exception\NoSuchEntityException
  54. * @throws \Magento\Framework\Exception\StateException
  55. */
  56. public function deleteById($attributeId);
  57. }