コード例 #1
0
ファイル: newsfeeditem.php プロジェクト: anqqa/Anqh
 /**
  * Magic getter
  *
  * @param  string  $key
  */
 public function __get($key)
 {
     $value = parent::__get($key);
     if ($key == 'data') {
         $value = is_null($value) ? null : json_decode($value, true);
     }
     return $value;
 }
コード例 #2
0
ファイル: comment.php プロジェクト: anqqa/Anqh
 public function __get($key)
 {
     if ($key == 'author') {
         return ORM::factory('user')->find_user($this->author_id);
     } else {
         return parent::__get($key);
     }
 }