Пример #1
0
 private function createPost(Profile $profile, Collection $collection, array $json) : Post
 {
     $this->output->writeln(sprintf(' [*] - Create post (id: %s)', $json['id']));
     $parameters = $this->createPostParameters($profile, $collection, $json);
     $this->collectionService->editThemeIds($collection->getId(), $json['themeIds']);
     $post = $this->postService->createPost($parameters);
     $post = $this->postService->replaceDateCreatedOn($post->getId(), \DateTime::createFromFormat('Y-m-d H:i:s', $json['createdOn']));
     $this->collectionService->editThemeIds($collection->getId(), []);
     return $post;
 }