filter('user_id', 'uint'); $count = $this->filter('count', 'uint'); $user = $this->assertRecordExists('XF:User', $userId); $user->rhpz_entry_count = $count; $user->save(); $trophyRepo = $this->repository('XF:Trophy'); $trophyRepo->updateTrophiesForUser($user); return $this->apiSuccess(['success' => true,'user_id' => $user->user_id,'count' => $count]); } public function actionPostFeatured(): AbstractReply { $entryId = $this->filter('entry_id', 'uint'); $userId = $this->filter('user_id', 'uint'); $entryTitle = $this->filter('entry_title', 'string'); /** @var EntryFeaturedRequest $entryFeaturedRequest */ $entryFeaturedRequest = $this->em()->create('RomhackPlaza\Master:EntryFeaturedRequest'); $entryFeaturedRequest->entry_id = $entryId; $entryFeaturedRequest->user_id = $userId; $entryFeaturedRequest->entry_title = $entryTitle; $entryFeaturedRequest->featured_request_state = 'moderated'; $entryFeaturedRequest->save(); return $this->apiSuccess(['success' => true]); } }