PHP Class Sonata\CustomerBundle\Controller\Api\AddressController

Author: Vincent Composieux ([email protected])
Show file Open project: sonata-project/ecommerce

Protected Properties

Property Type Description
$addressManager Sonata\Component\Customer\AddressManagerInterface
$formFactory Symfony\Component\Form\FormFactoryInterface

Public Methods

Method Description
__construct ( Sonata\Component\Customer\AddressManagerInterface $addressManager, Symfony\Component\Form\FormFactoryInterface $formFactory ) Constructor.
deleteAddressAction ( integer $id ) : FOS\RestBundle\View\View Deletes an address.
getAddressAction ( $id ) : Sonata\Component\Customer\AddressInterface Retrieves a specific address.
getAddressesAction ( FOS\RestBundle\Request\ParamFetcherInterface $paramFetcher ) : Sonata\DatagridBundle\Pager\PagerInterface Returns a paginated list of addresses.
postAddressAction ( Request $request ) : Sonata\Component\Customer\AddressInterface Adds an address.
putAddressAction ( integer $id, Request $request ) : Address Updates an address.

Protected Methods

Method Description
getAddress ( integer $id ) : Sonata\Component\Customer\AddressInterface Retrieves address with id $id or throws an exception if it doesn't exist.
handleWriteAddress ( Request $request, integer | null $id = null ) : FOS\RestBundle\View\View | FormInterface Write an address, this method is used by both POST and PUT action methods.

Method Details

__construct() public method

Constructor.
public __construct ( Sonata\Component\Customer\AddressManagerInterface $addressManager, Symfony\Component\Form\FormFactoryInterface $formFactory )
$addressManager Sonata\Component\Customer\AddressManagerInterface
$formFactory Symfony\Component\Form\FormFactoryInterface

deleteAddressAction() public method

Deletes an address.
public deleteAddressAction ( integer $id ) : FOS\RestBundle\View\View
$id integer An Address identifier
return FOS\RestBundle\View\View

getAddress() protected method

Retrieves address with id $id or throws an exception if it doesn't exist.
protected getAddress ( integer $id ) : Sonata\Component\Customer\AddressInterface
$id integer
return Sonata\Component\Customer\AddressInterface

getAddressAction() public method

Retrieves a specific address.
public getAddressAction ( $id ) : Sonata\Component\Customer\AddressInterface
$id
return Sonata\Component\Customer\AddressInterface

getAddressesAction() public method

Returns a paginated list of addresses.
public getAddressesAction ( FOS\RestBundle\Request\ParamFetcherInterface $paramFetcher ) : Sonata\DatagridBundle\Pager\PagerInterface
$paramFetcher FOS\RestBundle\Request\ParamFetcherInterface
return Sonata\DatagridBundle\Pager\PagerInterface

handleWriteAddress() protected method

Write an address, this method is used by both POST and PUT action methods.
protected handleWriteAddress ( Request $request, integer | null $id = null ) : FOS\RestBundle\View\View | FormInterface
$request Symfony\Component\HttpFoundation\Request Symfony request
$id integer | null An Address identifier
return FOS\RestBundle\View\View | FormInterface

postAddressAction() public method

Adds an address.
public postAddressAction ( Request $request ) : Sonata\Component\Customer\AddressInterface
$request Symfony\Component\HttpFoundation\Request A Symfony request
return Sonata\Component\Customer\AddressInterface

putAddressAction() public method

Updates an address.
public putAddressAction ( integer $id, Request $request ) : Address
$id integer An Address identifier
$request Symfony\Component\HttpFoundation\Request A Symfony request
return Address

Property Details

$addressManager protected property

protected AddressManagerInterface,Sonata\Component\Customer $addressManager
return Sonata\Component\Customer\AddressManagerInterface

$formFactory protected property

protected FormFactoryInterface,Symfony\Component\Form $formFactory
return Symfony\Component\Form\FormFactoryInterface