|
@@ 54-61 (lines=8) @@
|
| 51 |
|
* @throws InvalidEntityPropertyException If entity does not have that property |
| 52 |
|
* @throws InvalidValueTypeForEntityPropertyException If value is of the wrong type |
| 53 |
|
*/ |
| 54 |
|
public function set($key, $value) |
| 55 |
|
{ |
| 56 |
|
if (!isset(self::getColumns()[$key])) { |
| 57 |
|
throw new InvalidEntityPropertyException([get_class($this), $key]); |
| 58 |
|
} |
| 59 |
|
|
| 60 |
|
$this->properties[$key] = $this->validatePropertyForValue($key, $value); |
| 61 |
|
} |
| 62 |
|
|
| 63 |
|
/** |
| 64 |
|
* Get entity property |
|
@@ 72-79 (lines=8) @@
|
| 69 |
|
* |
| 70 |
|
* @throws InvalidEntityPropertyException If entity does not have that property |
| 71 |
|
*/ |
| 72 |
|
public function get($key) |
| 73 |
|
{ |
| 74 |
|
if (!isset(self::getColumns()[$key])) { |
| 75 |
|
throw new InvalidEntityPropertyException([get_class($this), $key]); |
| 76 |
|
} |
| 77 |
|
|
| 78 |
|
return $this->properties[$key]; |
| 79 |
|
} |
| 80 |
|
|
| 81 |
|
/** |
| 82 |
|
* Return table structur for saving |