Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Argument.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
15 class Argument implements FieldInterface
16 {
20  private $name;
21 
25  private $type;
26 
30  private $description;
31 
35  private $baseType;
36 
40  private $required;
41 
45  private $isList;
46 
50  private $itemsRequired;
51 
55  private $defaultValue;
56 
68  public function __construct(
69  string $name,
70  string $type,
71  string $baseType,
72  string $description,
73  bool $required,
74  bool $isList,
75  string $itemType = '',
76  bool $itemsRequired = false,
77  string $defaultValue = null
78  ) {
79  $this->name = $name;
80  $this->type = $isList ? $itemType : $type;
81  $this->baseType = $baseType;
82  $this->description = $description;
83  $this->required = $required;
84  $this->isList = $isList;
85  $this->itemsRequired = $itemsRequired;
86  $this->defaultValue = $defaultValue;
87  }
88 
94  public function getName() : string
95  {
96  return $this->name;
97  }
98 
104  public function getTypeName() : string
105  {
106  return $this->type;
107  }
108 
114  public function getBaseType() : string
115  {
116  return $this->baseType;
117  }
118 
124  public function isList() : bool
125  {
126  return $this->isList;
127  }
128 
134  public function isRequired() : bool
135  {
136  return $this->required;
137  }
138 
144  public function areItemsRequired() : bool
145  {
146  return $this->itemsRequired;
147  }
148 
154  public function getDescription() : string
155  {
156  return $this->description;
157  }
158 
164  public function getDefaultValue() : ?string
165  {
166  return $this->defaultValue;
167  }
168 
174  public function hasDefaultValue() : bool
175  {
176  return $this->defaultValue ? true: false;
177  }
178 }
$type
Definition: item.phtml:13
__construct(string $name, string $type, string $baseType, string $description, bool $required, bool $isList, string $itemType='', bool $itemsRequired=false, string $defaultValue=null)
Definition: Argument.php:68
$required
Definition: wrapper.phtml:8
if(!isset($_GET['name'])) $name
Definition: log.php:14