Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach ($comments as &$comment) {
- $subcomments = $commentRepo->getSubComments($comment->getId());
- $comment->subComments = $subcomments;
- }
- $response = [
- 'comments' => $comments,
- 'id' => $id,
- 'totalPages' => $totalPages
- ];
- return new JsonResponse($response);
- ArticleController.php on line 194:
- array:3 [
- "comments" => array:1 [
- 0 => & Comment {#7263
- -id: 168
- -content: "Лошо е"
- -person: User {#5420
- #id: 3
- -firstName: "testtt"
- -favouriteArticles: PersistentCollection {#5653
- -snapshot: []
- -owner: User {#5420}
- -association: array:19 [ …19]
- -em: EntityManager {#3456 …11}
- -backRefFieldName: null
- -typeClass: ClassMetadata {#5424 …}
- -isDirty: false
- #collection: ArrayCollection {#5688
- -elements: []
- }
- #initialized: true
- }
- #username: "test@test.com"
- #usernameCanonical: "test@test.com"
- #email: "test@test.com"
- #emailCanonical: "test@test.com"
- #enabled: true
- #salt: null
- #password: "$2y$13$.8Ky5Jj71PUsGD9E04nre./xClPVZ/Uiia40PTQjGmMAqOFpW2mwi"
- #plainPassword: null
- #lastLogin: DateTime {#5416
- +"date": "2019-01-07 09:39:06.000000"
- +"timezone_type": 3
- +"timezone": "UTC"
- }
- #confirmationToken: null
- #passwordRequestedAt: null
- #groups: null
- #roles: []
- }
- -dateAdded: DateTime {#7260
- +"date": "2019-01-09 11:02:35.000000"
- +"timezone_type": 3
- +"timezone": "UTC"
- }
- -replyTo: 0
- -postId: 8
- +"subComments": []
- }
- ]
- "id" => "8"
- "totalPages" => 2.0
- ]
Add Comment
Please, Sign In to add comment