| @@ 74-76 (lines=3) @@ | ||
| 71 | */ |
|
| 72 | public function set(string $key, $value) |
|
| 73 | { |
|
| 74 | if (isset(self::getColumns()[$key]) === false) { |
|
| 75 | throw new InvalidEntityPropertyException([get_class($this), $key]); |
|
| 76 | } |
|
| 77 | ||
| 78 | $newValue = $this->validatePropertyValueType($key, $value); |
|
| 79 | ||
| @@ 104-106 (lines=3) @@ | ||
| 101 | */ |
|
| 102 | public function get(string $key) |
|
| 103 | { |
|
| 104 | if (!isset(self::getColumns()[$key])) { |
|
| 105 | throw new InvalidEntityPropertyException([get_class($this), $key]); |
|
| 106 | } |
|
| 107 | ||
| 108 | return $this->properties[$key]; |
|
| 109 | } |
|
| @@ 124-126 (lines=3) @@ | ||
| 121 | */ |
|
| 122 | public function validatePropertyValueType(string $key, $value) |
|
| 123 | { |
|
| 124 | if (!isset(self::getColumns()[$key])) { |
|
| 125 | throw new InvalidEntityPropertyException([get_class($this), $key]); |
|
| 126 | } |
|
| 127 | ||
| 128 | /** |
|
| 129 | * Allow NULL |
|