ConditionInterface.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\SalesRule\Api\Data;
  7. /**
  8. * Interface ConditionInterface
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface ConditionInterface extends \Magento\Framework\Api\ExtensibleDataInterface
  14. {
  15. const AGGREGATOR_TYPE_ALL = 'all';
  16. const AGGREGATOR_TYPE_ANY = 'any';
  17. /**
  18. * Get condition type
  19. *
  20. * @return string
  21. */
  22. public function getConditionType();
  23. /**
  24. * @param string $conditionType
  25. * @return $this
  26. */
  27. public function setConditionType($conditionType);
  28. /**
  29. * Return list of conditions
  30. *
  31. * @return \Magento\SalesRule\Api\Data\ConditionInterface[]|null
  32. */
  33. public function getConditions();
  34. /**
  35. * Set conditions
  36. *
  37. * @param \Magento\SalesRule\Api\Data\ConditionInterface[]|null $conditions
  38. * @return $this
  39. */
  40. public function setConditions(array $conditions = null);
  41. /**
  42. * Return the aggregator type
  43. *
  44. * @return string|null
  45. */
  46. public function getAggregatorType();
  47. /**
  48. * Set the aggregator type
  49. *
  50. * @param string $aggregatorType
  51. * @return $this
  52. */
  53. public function setAggregatorType($aggregatorType);
  54. /**
  55. * Return the operator of the condition
  56. *
  57. * @return string
  58. */
  59. public function getOperator();
  60. /**
  61. * Set the operator of the condition
  62. *
  63. * @param string $operator
  64. * @return $this
  65. */
  66. public function setOperator($operator);
  67. /**
  68. * Return the attribute name of the condition
  69. *
  70. * @return string|null
  71. */
  72. public function getAttributeName();
  73. /**
  74. * Set the attribute name of the condition
  75. *
  76. * @param string $attributeName
  77. * @return $this
  78. */
  79. public function setAttributeName($attributeName);
  80. /**
  81. * Return the value of the condition
  82. *
  83. * @return mixed
  84. */
  85. public function getValue();
  86. /**
  87. * Return the value of the condition
  88. *
  89. * @param mixed $value
  90. * @return $this
  91. */
  92. public function setValue($value);
  93. /**
  94. * Retrieve existing extension attributes object or create a new one.
  95. *
  96. * @return \Magento\SalesRule\Api\Data\ConditionExtensionInterface|null
  97. */
  98. public function getExtensionAttributes();
  99. /**
  100. * Set an extension attributes object.
  101. *
  102. * @param \Magento\SalesRule\Api\Data\ConditionExtensionInterface $extensionAttributes
  103. * @return $this
  104. */
  105. public function setExtensionAttributes(
  106. \Magento\SalesRule\Api\Data\ConditionExtensionInterface $extensionAttributes
  107. );
  108. }