A lot of things

This commit is contained in:
2026-06-16 16:21:43 +02:00
parent 4415a2e8c4
commit 73471162bf
37 changed files with 654 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
<?php
namespace RomhackPlaza\Master\Api\Controller;
use RomhackPlaza\Master\Entity\EntryFeaturedRequest;
use XF\Api\Controller\AbstractController;
use XF\Mvc\Reply\AbstractReply;
@@ -22,4 +23,23 @@ class EntryController extends AbstractController
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]);
}
}