Пример #1
0
 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
 public function __construct($options = null)
 {
     parent::__construct($options);
 }