socialPostRepository = $socialPostRepository; } /** * @param int $exportId [description] * * @return array|null [description] */ public function list(int $exportId) { $posts = $this->socialPostRepository->findByExportId($exportId); $result = []; if(!empty($posts)){ foreach($posts as $post) { $result[] = [ 'id' => $post->getId(), 'name' => $post->getTitle() ]; } } return $result; } }