setValue
15 September 2009
10:05
as PHP
| 1 | if ($value !== NULL) { |
|---|---|
| 2 | if (class_exists($this->dataType)) { |
| 3 | if ($this->dataTypeClassSchema !== NULL) { |
| 4 | if (is_numeric($value)) { |
| 5 | $value = $this->findObjectByUid($value); |
| 6 | } elseif (is_array($value)) { |
| 7 | $value = $this->propertyMapper->map(array_keys($value), $value, $this->dataType); |
| 8 | } |
| 9 | } else { |
| 10 | if (is_array($value)) { |
| 11 | $value = $this->propertyMapper->map(array_keys($value), $value, $this->dataType); |
| 12 | } else { |
| 13 | // exception |
| 14 | } |
| 15 | } |
| 16 | if (!($value instanceof $this->dataType)) { |
| 17 | throw new Tx_Extbase_MVC_Exception_InvalidArgumentValue('The value must be of type "' . $this->dataType . '".', 1251730701); |
| 18 | } |
| 19 | } |
| 20 | $this->value = $value; |
| 21 | |
| 22 | return $this; |
| 23 | } |
Comments
No comments so far.
