예제 #1
0
파일: Post.php 프로젝트: kminkov/Blog
 public function toArray()
 {
     $array = parent::toArray();
     if (isset($this->category->id) && $this->category->id) {
         $array['category_id'] = $this->category->id;
     }
     if (isset($this->user) && $this->user->id) {
         $array['user_id'] = $this->user->id;
     }
     if (!$this->is_published) {
         $array['is_published'] = 0;
     }
     return $array;
 }
예제 #2
0
파일: User.php 프로젝트: kminkov/Blog
 public function __construct($options = null)
 {
     parent::__construct($options);
 }