Example #1
0
 public function getModel()
 {
     $model = new Statement();
     $model->setTitle($this->_data['title']);
     $model->setText($this->_data['text']);
     $model->setCategory($this->_data['category']);
     $model->setType($this->_data['type']);
     if ($this->_user->user_id) {
         $model->setUserId($this->_user->user_id);
         $model->setUsername($this->_user->name);
     } else {
         $model->setUserId(0);
         $model->setUsername($this->_data['name']);
         $model->setEmail($this->_data['email']);
     }
     return $model;
 }