45 lines
1.1 KiB
PHP
45 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Controller\TAPI;
|
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
|
use Symfony\Component\HttpFoundation\Request;
|
|
|
|
use Doctrine\ORM\Query;
|
|
use Doctrine\ORM\EntityManagerInterface;
|
|
|
|
use Catalyst\ApiBundle\Controller\ApiController;
|
|
use Catalyst\ApiBundle\Response\APIResponse;
|
|
|
|
use App\Entity\Promo;
|
|
|
|
use Catalyst\AuthBundle\Service\ACLGenerator as ACLGenerator;
|
|
|
|
class PromoController extends APIController
|
|
{
|
|
protected $acl_gen;
|
|
|
|
public function __construct(ACLGenerator $acl_gen)
|
|
{
|
|
$this->acl_gen = $acl_gen;
|
|
}
|
|
|
|
public function listPromos(Request $req, EntityManagerInterface $em)
|
|
{
|
|
$this->denyAccessUnlessGranted('tapi_promo.list', null, 'No access.');
|
|
|
|
// check required parameters and api key
|
|
$required_params = [];
|
|
$msg = $this->checkRequiredParameters($req, $required_params);
|
|
if ($msg)
|
|
return new APIResponse(false, $msg);
|
|
|
|
$data = [];
|
|
// TODO: add call to get promos here
|
|
|
|
$message = 'Promos found.';
|
|
|
|
return new APIResponse(true, $message, $data);
|
|
}
|
|
|
|
}
|