Overview

Namespaces

  • ApiBundle
    • DataFixtures
      • Faker
        • Provider
    • DependencyInjection
    • Doctrine
      • DBAL
        • Type
      • ORM
        • Filter
          • User
    • Entity
    • EventListener
      • Doctrine
    • Manager
    • Utils
  • FrontBundle
    • Bundle
      • UserBundle
    • Client
      • Exception
    • Controller
    • DependencyInjection
    • Form
      • DataTransformer
      • Type
    • Menu
    • Security
      • Http
        • Authentication
    • Services
      • Http
    • Twig
    • Utils

Classes

  • BaseController
  • DashboardController
  • JobController
  • MandateController
  • UserController

Interfaces

  • ApiControllerInterface
  • Overview
  • Namespace
  • Class

Class BaseController

Symfony\Bundle\FrameworkBundle\Controller\Controller
Extended by FrontBundle\Controller\BaseController implements FrontBundle\Controller\ApiControllerInterface

Direct known subclasses

FrontBundle\Controller\JobController, FrontBundle\Controller\MandateController, FrontBundle\Controller\UserController
Namespace: FrontBundle\Controller
Author: Théo FIDRY theo.fidry@gmail.com
Located at FrontBundle/Controller/BaseController.php
Methods summary
public
# setContainer( Symfony\Component\DependencyInjection\ContainerInterface $container = null )
public string
# generateUrl( string $route, array $parameters = [], boolean|string $referenceType = FrontBundle\Controller\UrlGeneratorInterface::ABSOLUTE_PATH )

Generates a URL from the given parameters.

Generates a URL from the given parameters.

Parameters

$route
The name of the route
$parameters
An array of parameters
$referenceType
The type of reference (one of the constants in UrlGeneratorInterface)

Returns

string
The generated URL

Implementation of

FrontBundle\Controller\ApiControllerInterface::generateUrl()
public array
# decode( string $data, array $context = [] )

Decodes a JSON string into PHP data.

Decodes a JSON string into PHP data.

Parameters

$data
Data to decode
$context
options that decoders have access to.

Returns

array

Throws

UnexpectedValueException

Implementation of

FrontBundle\Controller\ApiControllerInterface::decode()
public Psr\Http\Message\RequestInterface
# createRequest( string $method, string|null $url = null, Symfony\Component\HttpFoundation\Request|Psr\Http\Message\RequestInterface|string|null $token = null, array $options = [], $wholeCollection = false )

Send a GET request for the client and decode its response body.

Send a GET request for the client and decode its response body.

Parameters

$method
HTTP method
$url
URL, URI or route name.
$token

API token. If request, will look into the session for the API token.

$options
Options applied to the request.
$wholeCollection

Returns

Psr\Http\Message\RequestInterface

Implementation of

FrontBundle\Controller\ApiControllerInterface::createRequest()
public array
# requestAndDecode( string $method, string|null $url = null, Symfony\Component\HttpFoundation\Request|Psr\Http\Message\RequestInterface|string|null $token = null, array $options = [], boolean $wholeCollection = false )

Send a GET request for the client and decode its response body.

Send a GET request for the client and decode its response body.

Parameters

$method
HTTP method
$url
URL, URI or route name.
$token

API token. If request, will look into the session for the API token.

$options
Options applied to the request.
$wholeCollection

If set to true, will consider the response is a paginated collection and will go through all pages to return the complete list of entities. This parameters is ignored if the response is not a collection.

Returns

array

Throws

LogicException
When the handler does not populate a response
GuzzleHttp\Exception\RequestException
When an error is encountered

Implementation of

FrontBundle\Controller\ApiControllerInterface::requestAndDecode()
public array
# sendAndDecode( Psr\Http\Message\RequestInterface $request, boolean $wholeCollection = false )

Sends a single request and decode its response body.

Sends a single request and decode its response body.

Parameters

$request
Request to send
$wholeCollection

If set to true, will consider the response is a paginated collection and will go through all pages to return the complete list of entities. This parameters is ignored if the response is not a collection.

Returns

array

Throws

LogicException
When the handler does not populate a response
GuzzleHttp\Exception\RequestException
When an error is encountered
UnexpectedValueException

Implementation of

FrontBundle\Controller\ApiControllerInterface::sendAndDecode()
public
# handleGuzzleException( GuzzleHttp\Exception\TransferException $exception )

Handle Guzzle exceptions. Assumes the exception was thrown while sending a request to the API. For more information regarding Guzzle exceptions, refer to * http://guzzle.readthedocs.org/en/latest/quickstart.html#exceptions.

Handle Guzzle exceptions. Assumes the exception was thrown while sending a request to the API. For more information regarding Guzzle exceptions, refer to * http://guzzle.readthedocs.org/en/latest/quickstart.html#exceptions.

Parameters

$exception

Implementation of

FrontBundle\Controller\ApiControllerInterface::handleGuzzleException()
public
# getDoctrine( )

Deprecated

Should not have to use Doctrine.

Throws

LogicException
If used.
Properties summary
protected FrontBundle\Client\ClientInterface $client
#
protected Symfony\Component\Serializer\SerializerInterface|Symfony\Component\Serializer\Normalizer\NormalizerInterface|Symfony\Component\Serializer\Encoder\DecoderInterface $serializer
#
API documentation generated by ApiGen