/** * @param ChildComment $comment The ChildComment object to add. */ protected function doAddComment(ChildComment $comment) { $this->collComments[] = $comment; $comment->setNote($this); }
protected function comment($id) { //TODO: check rights $note = NoteQuery::create()->findPK($id); $comment = new Comment(); $comment->setUser($this->params['user']); $comment->setNote($note); $comment->setText($_POST['msg']); $comment->save(); $this->params['comments'] = $note->getComments(); $this->renderType('js.phtml'); }