Lines Matching refs:value
15 * A list of value metadata
34 * @param null|array $value
38 public function setValue($value): Metadata
40 if ($value === null) {
41 $this->array = $value;
44 if (!is_array($value)) {
45 throw new ExceptionCompile("The value is not an array. Value: " . var_export($value, true));
47 $this->array = $value;
67 throw new ExceptionNotFound("No default multiples value");
119 public function setFromStoreValue($value): Metadata
121 $values = $this->toArrayOrNull($value);
127 foreach ($values as $value) {
128 if (!in_array($value, $possibleValues)) {
129 throw new ExceptionBadArgument("The value ($value) for ($this) is not a possible value (" . implode(",", $possibleValues) . ")", $this->getCanonical());
140 protected function toArrayOrNull($value): ?array
145 if ($value === null || $value === "") {
152 if (is_array($value)) {
153 return $value;
159 if (!is_string($value)) {
160 throw new ExceptionBadArgument("The value for $this is not an array, nor a string (value: $value)", get_class($this));
163 return explode($stringSeparator, $value);
168 public function setFromStoreValueWithoutException($value): Metadata
171 $this->array = $this->toArrayOrNull($value);