public function findPageByTopicAndPost(TopicInterface $topic, PostInterface $post, $limit = 10) { if ($limit < 1) { throw new \InvalidArgumentException('Limit must be a value greater than or equal to 1.'); } $position = $this->repository->findPositionByTopicAndPost($topic, $post); return ceil($position / $limit); }