Created
May 8, 2015 14:48
-
-
Save Keeo/b3dffd1f3f1c61824575 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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