$property; } return parent::__get($property); } public function __construct($model, $defaults=array()) { parent::__construct($model, $defaults); $this->validator->set_rules(array( 'content' => array(array('length', 10000), 'NOT NULL') )); //new object if ($this->id === NULL) { $this->author = $this->model->user_nick; $this->create_date = date('c'); $this->last_modification_date = $this->create_date; if (!isset($defaults['task'])) { throw new \Exception('$defaults[task] not set'); } $this->task = $defaults['task']; $this->task_id = $this->task->id; } else { if ($this->task_id != '') { if (isset($defaults['task']) && $this->task_id == $defaults['task']->id) { $this->task = $defaults['task']; } elseif ($this->task_id != null) { $this->task = $this->model->taskFactory->get_one($this->task_id); } } } } public function set_data($post) { parent::set_data($post); $this->content_html = p_render('xhtml',p_get_instructions($this->content), $ignore); } public function mail_notify_add() { $rep = array( 'content' => $this->content, 'content_html' => $this->content_html, 'who' => $this->author, 'when' => $this->create_date ); $rep['action'] = $this->model->action->getLang('mail_comment_added'); $rep['action_color'] = 'transparent'; $rep['action_border_color'] = '#E5E5E5'; //$this->thread->mail_notify($rep); } }