コード例 #1
0
 /**
  * @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']);
     }
 }
コード例 #2
0
 /**
  * @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');
     }
 }
コード例 #3
0
 /**
  * @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');
     }
 }
コード例 #4
0
 /**
  * @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']);
     }
 }
コード例 #6
0
 /**
  * @param ConfigureApiController $event
  */
 public function includeLinksRelationship(ConfigureApiController $event)
 {
     if ($event->isController(ShowForumController::class)) {
         $event->addInclude(['links']);
     }
 }
コード例 #7
0
 /**
  * @param ConfigureApiController $event
  */
 public function includeStartPost(ConfigureApiController $event)
 {
     if ($event->isController(ListDiscussionsController::class)) {
         $event->addInclude('startPost');
     }
 }
コード例 #8
0
 /**
  * @param ConfigureApiController $event
  */
 public function includeTagsRelationship(ConfigureApiController $event)
 {
     if ($event->isController(ShowForumController::class)) {
         $event->addInclude(['tags', 'tags.lastDiscussion', 'tags.parent']);
     }
 }