/** * @param ConfigureApiController $event */ public function includeLikes(ConfigureApiController $event) { if ($event->isController(Controller\ShowDiscussionController::class)) { $event->addInclude('posts.likes'); } if ($event->isController(Controller\ListPostsController::class) || $event->isController(Controller\ShowPostController::class) || $event->isController(Controller\CreatePostController::class) || $event->isController(Controller\UpdatePostController::class)) { $event->addInclude('likes'); } }
/** * @param ConfigureApiController $event */ public function includeFlagsRelationship(ConfigureApiController $event) { if ($event->isController(Controller\ShowDiscussionController::class)) { $event->addInclude(['posts.flags', 'posts.flags.user']); } if ($event->isController(Controller\ListPostsController::class) || $event->isController(Controller\ShowPostController::class)) { $event->addInclude(['flags', 'flags.user']); } }
/** * @param ConfigureApiController $event */ public function includeModeratorNotesRelationship(ConfigureApiController $event) { if ($event->isController(Controller\ShowDiscussionController::class)) { $event->addInclude(['posts.moderatorNotes', 'posts.moderatorNotes.user']); } if ($event->isController(Controller\ListPostsController::class) || $event->isController(Controller\ShowPostController::class)) { $event->addInclude(['moderatorNotes', 'moderatorNotes.user']); } }
/** * @param ConfigureApiController $event */ public function includeTagsRelationship(ConfigureApiController $event) { if ($event->isController(Controller\ListDiscussionsController::class) || $event->isController(Controller\ShowDiscussionController::class) || $event->isController(Controller\CreateDiscussionController::class)) { $event->addInclude('tags'); } if ($event->isController(Controller\CreateDiscussionController::class)) { $event->addInclude('tags.lastDiscussion'); } }
/** * @param ConfigureApiController $event */ public function includeRelationships(ConfigureApiController $event) { if ($event->isController(ShowDiscussionController::class)) { $event->addInclude(['posts.mentionedBy', 'posts.mentionedBy.user', 'posts.mentionedBy.discussion']); } if ($event->isController(ShowPostController::class) || $event->isController(ListPostsController::class)) { $event->addInclude(['mentionedBy', 'mentionedBy.user', 'mentionedBy.discussion']); } if ($event->isController(CreatePostController::class)) { $event->addInclude(['mentionsPosts', 'mentionsPosts.mentionedBy']); } }
/** * @param ConfigureApiController $event */ public function includeLinksRelationship(ConfigureApiController $event) { if ($event->isController(ShowForumController::class)) { $event->addInclude(['links']); } }
/** * @param ConfigureApiController $event */ public function includeStartPost(ConfigureApiController $event) { if ($event->isController(ListDiscussionsController::class)) { $event->addInclude('startPost'); } }
/** * @param ConfigureApiController $event */ public function includeTagsRelationship(ConfigureApiController $event) { if ($event->isController(ShowForumController::class)) { $event->addInclude(['tags', 'tags.lastDiscussion', 'tags.parent']); } }