Model::__get PHP Method

__get() public method

Magic getter method, allows $model->property access to data.
public __get ( string $property ) : null | string
$property string
return null | string
    public function __get($property)
    {
        return $this->orm->get($property);
    }

Usage Example

示例#1
0
 public function __get($name)
 {
     $r = parent::__get($name);
     if (isset($r)) {
         return $this->markdown($r);
     }
     try {
         if ($trans = $this->translations()->filter('language')->find_one()) {
             $r = $trans->{$name};
             if (isset($r)) {
                 return $this->markdown($r);
             }
         }
     } catch (Exception $e) {
     }
     try {
         $r = $this->metas()->where('key', $name);
         if ($r->count() > 0) {
             $r = $r->find_one();
             return $r->field == 'text' || $r->field == 'textarea' ? $this->markdown($r->value) : $r->value;
         }
     } catch (Exception $e) {
     }
     return null;
 }
All Usage Examples Of Model::__get