PHP Interface Sulu\Bundle\ContactBundle\Contact\ContactManagerInterface

显示文件 Open project: sulu/sulu Interface Usage Examples

Public Methods

Method Description
addAddress ( $entity, Address $address, boolean $isMain ) adds an address to the entity.
getAddressRelations ( $entity ) : mixed Returns a collection of relations to get addresses.
getById ( $id, $locale ) : mixed Returns an api entity.
getByIds ( $ids, $locale ) : mixed Returns api entities.
removeAddressRelation ( $entity, $address ) : mixed removes the address relation from a contact and also deletes the address if it has no more relations.
setMainEmail ( $entity ) : mixed sets main email, based on emails that are set on entity.
setMainFax ( $entity ) : mixed sets main fax, based on faxes that are set on entity.
setMainForCollection ( $arrayCollection ) sets the first element to main, if none is set.
setMainPhone ( $entity ) : mixed sets main phone, based on phones that are set on entity.
setMainUrl ( $entity ) : mixed sets main url, based on urls that are set on entity.
unsetMain ( $arrayCollection ) : boolean unsets main of all elements of an ArrayCollection | PersistanceCollection.

Method Details

addAddress() public method

adds an address to the entity.
public addAddress ( $entity, Address $address, boolean $isMain )
$entity The entity to add the address to
$address Sulu\Bundle\ContactBundle\Entity\Address The address to be added
$isMain boolean Defines if the address is the main Address of the contact

getAddressRelations() public method

Returns a collection of relations to get addresses.
public getAddressRelations ( $entity ) : mixed
$entity
return mixed

getById() public method

Returns an api entity.
public getById ( $id, $locale ) : mixed
$id
$locale
return mixed

getByIds() public method

Returns api entities.
public getByIds ( $ids, $locale ) : mixed
$ids
$locale
return mixed

removeAddressRelation() public method

removes the address relation from a contact and also deletes the address if it has no more relations.
public removeAddressRelation ( $entity, $address ) : mixed
$entity
$address
return mixed

setMainEmail() public method

sets main email, based on emails that are set on entity.
public setMainEmail ( $entity ) : mixed
$entity
return mixed

setMainFax() public method

sets main fax, based on faxes that are set on entity.
public setMainFax ( $entity ) : mixed
$entity
return mixed

setMainForCollection() public method

sets the first element to main, if none is set.
public setMainForCollection ( $arrayCollection )
$arrayCollection

setMainPhone() public method

sets main phone, based on phones that are set on entity.
public setMainPhone ( $entity ) : mixed
$entity
return mixed

setMainUrl() public method

sets main url, based on urls that are set on entity.
public setMainUrl ( $entity ) : mixed
$entity
return mixed

unsetMain() public method

unsets main of all elements of an ArrayCollection | PersistanceCollection.
public unsetMain ( $arrayCollection ) : boolean
$arrayCollection
return boolean returns true if a element was unset