use eZ\Publish\API\Repository\Exceptions\PropertyNotFoundException;
6
7
abstract class AbstractValue
8
{
9
/**
10
* Magic get function handling read to non public properties
11
*
12
* Returns value for all readonly (protected) properties.
13
*
14
* @ignore This method is for internal use
15
* @access private
16
*
17
* @throws \eZ\Publish\API\Repository\Exceptions\PropertyNotFoundException exception on all reads to undefined properties so typos are not silently accepted.
18
*
19
* @param string $property Name of the property
20
*
21
* @return mixed
22
*/
23
71
public function __get($property)
24
{
25
71
if (property_exists($this, $property))
26
{
27
71
return $this->$property;
28
}
29
throw new PropertyNotFoundException($property, get_class($this));
30
}
31
32
/**
33
* Magic isset function handling isset() to non public properties
34
*
35
* Returns true for all (public/)protected/private properties.