Created
November 15, 2015 15:44
-
-
Save neok/8d2e645ccb69458bf803 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme\DemoBundle\Controller | |
use FOS\RestBundle\Request\ParamFetcher; | |
use FOS\RestBundle\Controller\Annotations as Rest; | |
class ItemExampleController | |
{ | |
/** | |
* Get Items By Constraints | |
* | |
* @Rest\QueryParam(name="id", array=true, requirements="\d+", default="-1", description="Identifier") | |
* @Rest\QueryParam(name="active", requirements="\d?", default="1", description="Active item") | |
* @Rest\View() | |
* | |
* @param ParamFetcher $paramFetcher | |
*/ | |
public function getListItemsAtion(ParamFetcher $paramFetcher) { | |
$parameters = $paramFetcher->all(); | |
return $this->getResource($parameters); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment