PHP Class Sulu\Bundle\ContactBundle\Controller\ContactController

Inheritance: extends Sulu\Component\Rest\RestController, implements FOS\RestBundle\Routing\ClassResourceInterface, implements Sulu\Component\Security\SecuredControllerInterface
ファイルを表示 Open project: sulu/sulu

Protected Properties

Property Type Description
$accountContactEntityName
$accountContactFieldDescriptors
$basePath string
$bundlePrefix
$contactSerializationGroups serialization groups for contact
$entityKey
$fieldDescriptors Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor\DoctrineFieldDescriptor[]
$positionEntityName

Public Methods

Method Description
cgetAction ( Request $request ) : Response lists all contacts optional parameter 'flat' calls listAction.
deleteAction ( integer $id ) : Response Deletes a Contact with the given ID from database.
fieldsAction ( Request $request ) : Response returns all fields that can be used by list.
getAction ( $id ) : Response Shows the contact with the given Id.
getSecurityContext ( )
patchAction ( $id, Request $request ) : Response Partially update an existing contact.
postAction ( Request $request ) : Response Creates a new contact.
putAction ( $id, Request $request ) : Response

Protected Methods

Method Description
getAccountContactFieldDescriptors ( )
getContactManager ( ) : ContactManager
getContactsByUserSystem ( ) Returns a list of contacts which have a user in the sulu system.
getFieldDescriptors ( )
getRestHelper ( ) : Sulu\Component\Rest\RestHelperInterface

Private Methods

Method Description
addAvatars ( array $contacts, string $locale ) : array Takes an array of contacts and resets the avatar containing the media id with the actual urls to the avatars thumbnail.
checkArguments ( Request $request ) https://github.com/sulu-io/sulu/issues/1136
getComparator ( ) : Sulu\Bundle\ContactBundle\Util\IndexComparatorInterface
getList ( Request $request, string $locale ) : ListRepresentation Returns list for cget.
initFieldDescriptors ( )
prepareListResponse ( Request $request, DoctrineListBuilder $listBuilder, string $locale ) : array Prepare list response.

Method Details

cgetAction() public method

lists all contacts optional parameter 'flat' calls listAction.
public cgetAction ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response

deleteAction() public method

Deletes a Contact with the given ID from database.
public deleteAction ( integer $id ) : Response
$id integer
return Symfony\Component\HttpFoundation\Response

fieldsAction() public method

returns all fields that can be used by list.
public fieldsAction ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response

getAccountContactFieldDescriptors() protected method

getAction() public method

Shows the contact with the given Id.
public getAction ( $id ) : Response
$id
return Symfony\Component\HttpFoundation\Response

getContactManager() protected method

protected getContactManager ( ) : ContactManager
return Sulu\Bundle\ContactBundle\Contact\ContactManager

getContactsByUserSystem() protected method

Returns a list of contacts which have a user in the sulu system.
protected getContactsByUserSystem ( )

getFieldDescriptors() protected method

protected getFieldDescriptors ( )

getRestHelper() protected method

protected getRestHelper ( ) : Sulu\Component\Rest\RestHelperInterface
return Sulu\Component\Rest\RestHelperInterface

getSecurityContext() public method

public getSecurityContext ( )

patchAction() public method

Partially update an existing contact.
public patchAction ( $id, Request $request ) : Response
$id
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response

postAction() public method

Creates a new contact.
public postAction ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response

putAction() public method

public putAction ( $id, Request $request ) : Response
$id
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response

Property Details

$accountContactEntityName protected_oe static_oe property

protected static $accountContactEntityName

$accountContactFieldDescriptors protected_oe property

protected $accountContactFieldDescriptors

$basePath protected_oe property

protected string $basePath
return string

$bundlePrefix protected_oe property

protected $bundlePrefix

$contactSerializationGroups protected_oe static_oe property

serialization groups for contact
protected static $contactSerializationGroups

$entityKey protected_oe static_oe property

protected static $entityKey

$fieldDescriptors protected_oe property

protected DoctrineFieldDescriptor[],Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor $fieldDescriptors
return Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor\DoctrineFieldDescriptor[]

$positionEntityName protected_oe static_oe property

protected static $positionEntityName