Skip to content

Instantly share code, notes, and snippets.

@Keeo
Created May 8, 2015 14:48
Show Gist options
  • Save Keeo/b3dffd1f3f1c61824575 to your computer and use it in GitHub Desktop.
Save Keeo/b3dffd1f3f1c61824575 to your computer and use it in GitHub Desktop.
public function allAction(ParamFetcher $paramFetcher, Request $request)
{
$data = $this->getResults($paramFetcher, $request);
foreach ($data['post'] as $post /* @var $post Post */) {
$comments = [];
$s = &$ret['post'][];
$s['id'] = $post->getId();
$s['company'] = $post->getCompany()->getId();
foreach ($post->getComments() as $comment) {
$comments[] = $comment->getId();
}
$s['comments'] = $comments;
$s['created'] = $post->getCreated();
$s['updated'] = $post->getUpdated();
$s['text'] = $post->getText();
}
$ret['meta'] = $data['meta'];
return $ret;
}
public function allAction(ParamFetcher $paramFetcher, Request $request)
{
return $this->getResults($paramFetcher, $request);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment