/** * * @access protected * @return string */ protected function getQuote() { $quote = ""; if (is_object($this->postToQuote) && $this->postToQuote instanceof Post) { $author = $this->postToQuote->getCreatedBy(); $body = $this->postToQuote->getBody(); $quote = '[QUOTE="' . $author . '"]' . $body . '[/QUOTE]'; } return $quote; }
/** * * @access protected * @param \Map2u\ForumBundle\Entity\Post $post */ protected function updateRegistryStats(Post $post) { $user = $post->getCreatedBy(); if ($user) { $registry = $this->registryModel->findOrCreateOneRegistryForUser($user); $postCount = $this->postModel->countPostsForUserById($user->getId()); $registry->setCachedPostCount($postCount ? $postCount : 0); $this->registryModel->saveRegistry($registry); } }