/** * persist - Persists a thread to the database. * * @param TopicInterface $thread * @return TopicInterface */ public function persist(TopicInterface $thread) { if ($thread->getId() > 0) { $this->update($thread, null, null, new TopicHydrator()); } else { $this->insert($thread, null, new TopicHydrator()); } return $thread; }