AttributeMetadataInterface.php 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Customer\Api\Data;
  7. /**
  8. * Customer attribute metadata interface.
  9. * @api
  10. * @since 100.0.2
  11. */
  12. interface AttributeMetadataInterface extends \Magento\Framework\Api\MetadataObjectInterface
  13. {
  14. /**#@+
  15. * Constants used as keys of data array
  16. */
  17. const ATTRIBUTE_CODE = 'attribute_code';
  18. const FRONTEND_INPUT = 'frontend_input';
  19. const INPUT_FILTER = 'input_filter';
  20. const STORE_LABEL = 'store_label';
  21. const VALIDATION_RULES = 'validation_rules';
  22. const OPTIONS = 'options';
  23. const VISIBLE = 'visible';
  24. const REQUIRED = 'required';
  25. const MULTILINE_COUNT = 'multiline_count';
  26. const DATA_MODEL = 'data_model';
  27. const USER_DEFINED = 'user_defined';
  28. const FRONTEND_CLASS = 'frontend_class';
  29. const SORT_ORDER = 'sort_order';
  30. const FRONTEND_LABEL = 'frontend_label';
  31. const SYSTEM = 'system';
  32. const NOTE = 'note';
  33. const BACKEND_TYPE = 'backend_type';
  34. const IS_USED_IN_GRID = 'is_used_in_grid';
  35. const IS_VISIBLE_IN_GRID = 'is_visible_in_grid';
  36. const IS_FILTERABLE_IN_GRID = 'is_filterable_in_grid';
  37. const IS_SEARCHABLE_IN_GRID = 'is_searchable_in_grid';
  38. /**#@-*/
  39. /**
  40. * Frontend HTML for input element.
  41. *
  42. * @return string
  43. */
  44. public function getFrontendInput();
  45. /**
  46. * Set frontend HTML for input element.
  47. *
  48. * @param string $frontendInput
  49. * @return $this
  50. */
  51. public function setFrontendInput($frontendInput);
  52. /**
  53. * Get template used for input (e.g. "date")
  54. *
  55. * @return string
  56. */
  57. public function getInputFilter();
  58. /**
  59. * Set template used for input (e.g. "date")
  60. *
  61. * @param string $inputFilter
  62. * @return $this
  63. */
  64. public function setInputFilter($inputFilter);
  65. /**
  66. * Get label of the store.
  67. *
  68. * @return string
  69. */
  70. public function getStoreLabel();
  71. /**
  72. * Set label of the store.
  73. *
  74. * @param string $storeLabel
  75. * @return $this
  76. */
  77. public function setStoreLabel($storeLabel);
  78. /**
  79. * Retrieve validation rules.
  80. *
  81. * @return \Magento\Customer\Api\Data\ValidationRuleInterface[]
  82. */
  83. public function getValidationRules();
  84. /**
  85. * Set validation rules.
  86. *
  87. * @param \Magento\Customer\Api\Data\ValidationRuleInterface[] $validationRules
  88. * @return $this
  89. */
  90. public function setValidationRules(array $validationRules);
  91. /**
  92. * Number of lines of the attribute value.
  93. *
  94. * @return int
  95. */
  96. public function getMultilineCount();
  97. /**
  98. * Set number of lines of the attribute value.
  99. *
  100. * @param int $multilineCount
  101. * @return $this
  102. */
  103. public function setMultilineCount($multilineCount);
  104. /**
  105. * Whether attribute is visible on frontend.
  106. *
  107. * @return bool
  108. */
  109. public function isVisible();
  110. /**
  111. * Set whether attribute is visible on frontend.
  112. *
  113. * @param bool $isVisible
  114. * @return $this
  115. */
  116. public function setIsVisible($isVisible);
  117. /**
  118. * Whether attribute is required.
  119. *
  120. * @return bool
  121. */
  122. public function isRequired();
  123. /**
  124. * Set whether attribute is required.
  125. *
  126. * @param bool $isRequired
  127. * @return $this
  128. */
  129. public function setIsRequired($isRequired);
  130. /**
  131. * Get data model for attribute.
  132. *
  133. * @return string
  134. */
  135. public function getDataModel();
  136. /**
  137. * Get data model for attribute.
  138. *
  139. * @param string $dataModel
  140. * @return $this
  141. */
  142. public function setDataModel($dataModel);
  143. /**
  144. * Return options of the attribute (key => value pairs for select)
  145. *
  146. * @return \Magento\Customer\Api\Data\OptionInterface[]
  147. */
  148. public function getOptions();
  149. /**
  150. * Set options of the attribute (key => value pairs for select)
  151. *
  152. * @param \Magento\Customer\Api\Data\OptionInterface[] $options
  153. * @return $this
  154. */
  155. public function setOptions(array $options = null);
  156. /**
  157. * Get class which is used to display the attribute on frontend.
  158. *
  159. * @return string
  160. */
  161. public function getFrontendClass();
  162. /**
  163. * Set class which is used to display the attribute on frontend.
  164. *
  165. * @param string $frontendClass
  166. * @return $this
  167. */
  168. public function setFrontendClass($frontendClass);
  169. /**
  170. * Whether current attribute has been defined by a user.
  171. *
  172. * @return bool
  173. */
  174. public function isUserDefined();
  175. /**
  176. * Set whether current attribute has been defined by a user.
  177. *
  178. * @param bool $isUserDefined
  179. * @return $this
  180. */
  181. public function setIsUserDefined($isUserDefined);
  182. /**
  183. * Get attributes sort order.
  184. *
  185. * @return int
  186. */
  187. public function getSortOrder();
  188. /**
  189. * Get attributes sort order.
  190. *
  191. * @param int $sortOrder
  192. * @return $this
  193. */
  194. public function setSortOrder($sortOrder);
  195. /**
  196. * Get label which supposed to be displayed on frontend.
  197. *
  198. * @return string
  199. */
  200. public function getFrontendLabel();
  201. /**
  202. * Set label which supposed to be displayed on frontend.
  203. *
  204. * @param string $frontendLabel
  205. * @return $this
  206. */
  207. public function setFrontendLabel($frontendLabel);
  208. /**
  209. * Get the note attribute for the element.
  210. *
  211. * @return string
  212. */
  213. public function getNote();
  214. /**
  215. * Set the note attribute for the element.
  216. *
  217. * @param string $note
  218. * @return $this
  219. */
  220. public function setNote($note);
  221. /**
  222. * Whether this is a system attribute.
  223. *
  224. * @return bool
  225. */
  226. public function isSystem();
  227. /**
  228. * Set whether this is a system attribute.
  229. *
  230. * @param bool $isSystem
  231. * @return $this
  232. */
  233. public function setIsSystem($isSystem);
  234. /**
  235. * Get backend type.
  236. *
  237. * @return string
  238. */
  239. public function getBackendType();
  240. /**
  241. * Set backend type.
  242. *
  243. * @param string $backendType
  244. * @return $this
  245. */
  246. public function setBackendType($backendType);
  247. /**
  248. * Whether it is used in customer grid
  249. *
  250. * @return bool|null
  251. */
  252. public function getIsUsedInGrid();
  253. /**
  254. * Whether it is visible in customer grid
  255. *
  256. * @return bool|null
  257. */
  258. public function getIsVisibleInGrid();
  259. /**
  260. * Whether it is filterable in customer grid
  261. *
  262. * @return bool|null
  263. */
  264. public function getIsFilterableInGrid();
  265. /**
  266. * Whether it is searchable in customer grid
  267. *
  268. * @return bool|null
  269. */
  270. public function getIsSearchableInGrid();
  271. /**
  272. * Set whether it is used in customer grid
  273. *
  274. * @param bool $isUsedInGrid
  275. * @return $this
  276. */
  277. public function setIsUsedInGrid($isUsedInGrid);
  278. /**
  279. * Set whether it is visible in customer grid
  280. *
  281. * @param bool $isVisibleInGrid
  282. * @return $this
  283. */
  284. public function setIsVisibleInGrid($isVisibleInGrid);
  285. /**
  286. * Set whether it is filterable in customer grid
  287. *
  288. * @param bool $isFilterableInGrid
  289. * @return $this
  290. */
  291. public function setIsFilterableInGrid($isFilterableInGrid);
  292. /**
  293. * Set whether it is searchable in customer grid
  294. *
  295. * @param bool $isSearchableInGrid
  296. * @return $this
  297. */
  298. public function setIsSearchableInGrid($isSearchableInGrid);
  299. }