public function createComment(Comment $c) { if ($c === null) { throw new Exceptions\NullPointerException("Argument comment was null"); } try { $c->setUpdated(new DateTime()); $c->setCreated(new DateTime()); $c->setAuthor($c->getEditor()); $this->commentDao->save($c); $this->invalidateEntityCache($c); $this->onCreate($c); } catch (\Exception $ex) { throw new Exceptions\DataErrorException($ex->getMessage(), $ex->getCode(), $ex->getPrevious()); } }