123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324 |
- <?php
- /**
- *
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Eav\Api\Data;
- use Magento\Framework\Api\CustomAttributesDataInterface;
- use Magento\Framework\Api\MetadataObjectInterface;
- /**
- * Interface AttributeInterface
- * @api
- * @since 100.0.2
- */
- interface AttributeInterface extends CustomAttributesDataInterface, MetadataObjectInterface
- {
- const ATTRIBUTE_ID = 'attribute_id';
- const IS_UNIQUE = 'is_unique';
- const SCOPE = 'scope';
- const FRONTEND_CLASS = 'frontend_class';
- const ATTRIBUTE_CODE = 'attribute_code';
- const FRONTEND_INPUT = 'frontend_input';
- const IS_REQUIRED = 'is_required';
- const OPTIONS = 'options';
- const IS_USER_DEFINED = 'is_user_defined';
- const FRONTEND_LABEL = 'frontend_label';
- const FRONTEND_LABELS = 'frontend_labels';
- const NOTE = 'note';
- const BACKEND_TYPE = 'backend_type';
- const BACKEND_MODEL = 'backend_model';
- const SOURCE_MODEL = 'source_model';
- const VALIDATE_RULES = 'validate_rules';
- const ENTITY_TYPE_ID = 'entity_type_id';
- /**
- * Retrieve id of the attribute.
- *
- * @return int|null
- */
- public function getAttributeId();
- /**
- * Set id of the attribute.
- *
- * @param int $attributeId
- * @return $this
- */
- public function setAttributeId($attributeId);
- /**
- * Retrieve code of the attribute.
- *
- * @return string
- */
- public function getAttributeCode();
- /**
- * Set code of the attribute.
- *
- * @param string $attributeCode
- * @return $this
- */
- public function setAttributeCode($attributeCode);
- /**
- * Frontend HTML for input element.
- *
- * @return string
- */
- public function getFrontendInput();
- /**
- * Set frontend HTML for input element.
- *
- * @param string $frontendInput
- * @return $this
- */
- public function setFrontendInput($frontendInput);
- /**
- * Retrieve entity type id
- *
- * @return string
- */
- public function getEntityTypeId();
- /**
- * Set entity type id
- *
- * @param string $entityTypeId
- * @return $this
- */
- public function setEntityTypeId($entityTypeId);
- /**
- * Whether attribute is required.
- *
- * @return bool
- * @SuppressWarnings(PHPMD.BooleanGetMethodName)
- */
- public function getIsRequired();
- /**
- * Set whether attribute is required.
- *
- * @param bool $isRequired
- * @return $this
- */
- public function setIsRequired($isRequired);
- /**
- * Return options of the attribute (key => value pairs for select)
- *
- * @return \Magento\Eav\Api\Data\AttributeOptionInterface[]|null
- */
- public function getOptions();
- /**
- * Set options of the attribute (key => value pairs for select)
- *
- * @param \Magento\Eav\Api\Data\AttributeOptionInterface[] $options
- * @return $this
- */
- public function setOptions(array $options = null);
- /**
- * Whether current attribute has been defined by a user.
- *
- * @return bool|null
- */
- public function getIsUserDefined();
- /**
- * Set whether current attribute has been defined by a user.
- *
- * @param bool $isUserDefined
- * @return $this
- */
- public function setIsUserDefined($isUserDefined);
- /**
- * Return frontend label for default store
- *
- * @return string|null
- */
- public function getDefaultFrontendLabel();
- /**
- * Set frontend label for default store
- *
- * @param string $defaultFrontendLabel
- * @return $this
- */
- public function setDefaultFrontendLabel($defaultFrontendLabel);
- /**
- * Return frontend label for each store
- *
- * @return \Magento\Eav\Api\Data\AttributeFrontendLabelInterface[]
- */
- public function getFrontendLabels();
- /**
- * Set frontend label for each store
- *
- * @param \Magento\Eav\Api\Data\AttributeFrontendLabelInterface[] $frontendLabels
- * @return $this
- */
- public function setFrontendLabels(array $frontendLabels = null);
- /**
- * Get the note attribute for the element.
- *
- * @return string|null
- */
- public function getNote();
- /**
- * Set the note attribute for the element.
- *
- * @param string $note
- * @return $this
- */
- public function setNote($note);
- /**
- * Get backend type.
- *
- * @return string|null
- */
- public function getBackendType();
- /**
- * Set backend type.
- *
- * @param string $backendType
- * @return $this
- */
- public function setBackendType($backendType);
- /**
- * Get backend model
- *
- * @return string|null
- */
- public function getBackendModel();
- /**
- * Set backend model
- *
- * @param string $backendModel
- * @return $this
- */
- public function setBackendModel($backendModel);
- /**
- * Get source model
- *
- * @return string|null
- */
- public function getSourceModel();
- /**
- * Set source model
- *
- * @param string $sourceModel
- * @return $this
- */
- public function setSourceModel($sourceModel);
- /**
- * Get default value for the element.
- *
- * @return string|null
- */
- public function getDefaultValue();
- /**
- * Set default value for the element.
- *
- * @param string $defaultValue
- * @return $this
- */
- public function setDefaultValue($defaultValue);
- /**
- * Whether this is a unique attribute
- *
- * @return string|null
- */
- public function getIsUnique();
- /**
- * Set whether this is a unique attribute
- *
- * @param string $isUnique
- * @return $this
- */
- public function setIsUnique($isUnique);
- /**
- * Retrieve frontend class of attribute
- *
- * @return string|null
- */
- public function getFrontendClass();
- /**
- * Set frontend class of attribute
- *
- * @param string $frontendClass
- * @return $this
- */
- public function setFrontendClass($frontendClass);
- /**
- * Retrieve validation rules.
- *
- * @return \Magento\Eav\Api\Data\AttributeValidationRuleInterface[]|null
- */
- public function getValidationRules();
- /**
- * Set validation rules.
- *
- * @param \Magento\Eav\Api\Data\AttributeValidationRuleInterface[] $validationRules
- * @return $this
- */
- public function setValidationRules(array $validationRules = null);
- /**
- * @return \Magento\Eav\Api\Data\AttributeExtensionInterface|null
- */
- public function getExtensionAttributes();
- /**
- * Set an extension attributes object
- *
- * @param \Magento\Eav\Api\Data\AttributeExtensionInterface $extensionAttributes
- * @return $this
- * @since 102.0.0
- */
- public function setExtensionAttributes(
- \Magento\Eav\Api\Data\AttributeExtensionInterface $extensionAttributes
- );
- }
|