GDS\Entity::__get PHP Method

__get() public method

. sorry
public __get ( $str_key ) : null
$str_key
return null
    public function __get($str_key)
    {
        if (isset($this->arr_data[$str_key])) {
            return $this->arr_data[$str_key];
        }
        return null;
    }

Usage Example

Beispiel #1
0
 public function __get($key)
 {
     // checking entity attributes
     if (isset($this->{$key})) {
         return parent::__get($key);
     }
     // checking relations
     if ($this->issetRelation($key)) {
         return $this->getRelation($key);
     }
     throw new Exception('Error ' . $key . ' is not set.');
 }