Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractBehavior.php
Go to the documentation of this file.
1 <?php
7 
15 {
22  abstract public function toArray();
23 
29  public function toOptionArray()
30  {
31  $optionArray = [['label' => __('-- Please Select --'), 'value' => '']];
32  $options = $this->toArray();
33  if (is_array($options) && count($options) > 0) {
34  foreach ($options as $value => $label) {
35  $optionArray[] = ['label' => $label, 'value' => $value];
36  }
37  }
38  return $optionArray;
39  }
40 
47  abstract public function getCode();
48 
56  public function getNotes($entityCode)
57  {
58  return [];
59  }
60 }
__()
Definition: __.php:13
$label
Definition: details.phtml:21
$value
Definition: gender.phtml:16