public function __construct($id, Posts $posts, Tags $tags) { parent::__construct(); $this->posts = $posts; $this->tags = $tags; $this->post = $this->posts->findOneBy(['id' => $id]); }