/** * This event is triggered when we create a new comments * * @param Comment $comment * @return boolean */ function onAddComment(Comment $comment) { if ($this->isSearchable()) { $searchable_object = new SearchableObject(); $searchable_object->setRelObjectManager(get_class($this->manager())); $searchable_object->setRelObjectId($this->getObjectId()); $searchable_object->setColumnName('comment' . $comment->getId()); $searchable_object->setContent($comment->getText()); $searchable_object->setIsPrivate($this->isPrivate()); $searchable_object->save(); try { Notifier::newObjectComment($comment, $this->getSubscribers()); } catch (Exception $e) { // nothing here, just suppress error... } // try } return true; }