Skip to content

Instantly share code, notes, and snippets.

@elnur
Created March 13, 2013 00:15
Show Gist options
  • Save elnur/5148332 to your computer and use it in GitHub Desktop.
Save elnur/5148332 to your computer and use it in GitHub Desktop.
<?php
namespace Experium\Controller\Api;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use JMS\DiExtraBundle\Annotation\Service;
use JMS\DiExtraBundle\Annotation\InjectParams;
use Elnur\AbstractControllerBundle\AbstractController;
use Experium\Manager\RequestManager;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* @Service("api.request_controller", parent="elnur.controller.abstract")
* @Route(service="api.request_controller")
*/
class RequestController extends AbstractController
{
/**
* @var RequestManager
*/
private $requestManager;
/**
* @InjectParams
*
* @param RequestManager $requestManager
*/
public function __construct(RequestManager $requestManager)
{
$this->requestManager = $requestManager;
}
/**
* @Route("/request")
* @Method("GET")
*
* @return array
*/
public function listAction()
{
return $this->requestManager->findByResponsible($this->getUser());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment