Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use Symfony\Component\Form\Extension\Core\Type\HiddenType;
- use Symfony\Component\HttpFoundation\Request;
- use Symfony\Component\HttpFoundation\Response;
- use Symfony\Component\HttpFoundation\Response\json;
- use Symfony\Bundle\FrameworkBundle\Controller\Controller;
- use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
- use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
- use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
- use FOS\RestBundle\View\View;
- use FOS\RestBundle\Controller\Annotations as FOSRest;
- use FOS\RestBundle\Controller\FOSRestController;
- use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
- use Symfony\Component\HttpFoundation\JsonResponse;
- use App\Repository\BusinessRepository;
- use App\Entity\BusinessPaymentMethod;
- use App\Entity\Business;
- class BusinessPaymentMethodC
- public function getAction()
- {
- $request = Request::createFromGlobals();
- $limit = $request->query->get('limit');
- $paymentmethods = $this->getDoctrine()->getRepository(BusinessPaymentMethod::class)->findAll(array(),array('name' => 'asc'),$limit);
- if($paymentmethods === null){
- $paymentmethodsView = new View(null, Response::HTTP_NOT_FOUND);
- }else{
- $paymentmethodsView = new View($paymentmethods);
- }
- $paymentmethodsView->setFormat('json');
- return $this->handleView($paymentmethodsView);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement