/** * @param TopicEvent $event */ public function onTopicPersist(TopicEvent $event) { $topic = $event->getTopic(); if (!$this->topicManager->isNewTopic($topic)) { return; } $topic->getCategory()->incrementTopicsCount(); }
public function __construct(PostInterface $post) { parent::__construct($post->getTopic()); $this->post = $post; }