PHP Class Sulu\Bundle\ContactBundle\Contact\AccountManager

Inheritance: extends AbstractContactManager, implements Sulu\Component\SmartContent\Orm\DataProviderRepositoryInterface
Mostrar archivo Open project: sulu/sulu Class Usage Examples

Protected Properties

Property Type Description
$addressEntity
$mediaRepository Sulu\Bundle\MediaBundle\Entity\MediaRepositoryInterface

Public Methods

Method Description
__construct ( Doctrine\Common\Persistence\ObjectManager $em, Sulu\Bundle\TagBundle\Tag\TagManagerInterface $tagManager, Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface $mediaManager, AccountFactory $accountFactory, AccountRepository $accountRepository, ContactRepository $contactRepository, Sulu\Bundle\MediaBundle\Entity\MediaRepositoryInterface $mediaRepository )
addAddress ( Account $account, Address $address, boolean $isMain = false ) : AccountAddress Adds an address to the entity.
deleteAllRelations ( $entity )
deleteBankAccounts ( $entity ) Deletes (not just removes) all bank-accounts which are assigned to a contact.
findAll ( string $locale, null $filter = null ) : array | null Returns all accounts.
findByFilters ( $filters, $page, $pageSize, $limit, $locale, $options = [] )
findContactsByAccountId ( integer $id, string $locale, boolean $onlyFetchMainAccounts = false ) : array | null Returns contacts by account id.
getAccount ( Sulu\Bundle\ContactBundle\Entity\Account $account, string $locale ) : null | Account Returns an api entity for an doctrine entity.
getAddressRelations ( $entity ) : mixed Returns a collection of relations to get addresses.
getById ( integer $id, string $locale ) : mixed Gets account by id.
getByIdAndInclude ( integer $id, string $locale, array $includes ) : Account Gets account by id - can include relations.
getByIds ( array $ids, string $locale ) : array Returns account entities by ids.
removeAddressRelation ( Sulu\Bundle\ContactBundle\Entity\AccountInterface $account, AccountAddress $accountAddress ) : mixed | void Removes the address relation from a contact and also deletes the address if it has no more relations.
setLogo ( Sulu\Bundle\ContactBundle\Entity\Account $account, integer $mediaId ) Takes an account-entity and the id of a media and adds the media as the logo of the account.
setMedias ( Sulu\Bundle\ContactBundle\Entity\Account $account, $medias ) Sets the medias of the given account to the given medias.

Protected Methods

Method Description
getApiObject ( Sulu\Bundle\ContactBundle\Entity\Account $account, string $locale ) : Account Takes a account entity and a locale and returns the api object.

Method Details

__construct() public method

public __construct ( Doctrine\Common\Persistence\ObjectManager $em, Sulu\Bundle\TagBundle\Tag\TagManagerInterface $tagManager, Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface $mediaManager, AccountFactory $accountFactory, AccountRepository $accountRepository, ContactRepository $contactRepository, Sulu\Bundle\MediaBundle\Entity\MediaRepositoryInterface $mediaRepository )
$em Doctrine\Common\Persistence\ObjectManager
$tagManager Sulu\Bundle\TagBundle\Tag\TagManagerInterface
$mediaManager Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface
$accountFactory AccountFactory
$accountRepository Sulu\Bundle\ContactBundle\Entity\AccountRepository
$contactRepository Sulu\Bundle\ContactBundle\Entity\ContactRepository
$mediaRepository Sulu\Bundle\MediaBundle\Entity\MediaRepositoryInterface

addAddress() public method

Adds an address to the entity.
public addAddress ( Account $account, Address $address, boolean $isMain = false ) : AccountAddress
$account Sulu\Bundle\ContactBundle\Api\Account 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
return Sulu\Bundle\ContactBundle\Entity\AccountAddress

deleteAllRelations() public method

public deleteAllRelations ( $entity )

deleteBankAccounts() public method

Deletes (not just removes) all bank-accounts which are assigned to a contact.
public deleteBankAccounts ( $entity )
$entity

findAll() public method

Returns all accounts.
public findAll ( string $locale, null $filter = null ) : array | null
$locale string
$filter null
return array | null

findByFilters() public method

public findByFilters ( $filters, $page, $pageSize, $limit, $locale, $options = [] )

findContactsByAccountId() public method

Returns contacts by account id.
public findContactsByAccountId ( integer $id, string $locale, boolean $onlyFetchMainAccounts = false ) : array | null
$id integer
$locale string
$onlyFetchMainAccounts boolean
return array | null

getAccount() public method

Returns an api entity for an doctrine entity.
public getAccount ( Sulu\Bundle\ContactBundle\Entity\Account $account, string $locale ) : null | Account
$account Sulu\Bundle\ContactBundle\Entity\Account
$locale string
return null | Sulu\Bundle\ContactBundle\Api\Account

getAddressRelations() public method

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

getApiObject() protected method

Takes a account entity and a locale and returns the api object.
protected getApiObject ( Sulu\Bundle\ContactBundle\Entity\Account $account, string $locale ) : Account
$account Sulu\Bundle\ContactBundle\Entity\Account
$locale string
return Sulu\Bundle\ContactBundle\Api\Account

getById() public method

Gets account by id.
public getById ( integer $id, string $locale ) : mixed
$id integer
$locale string
return mixed

getByIdAndInclude() public method

Gets account by id - can include relations.
public getByIdAndInclude ( integer $id, string $locale, array $includes ) : Account
$id integer
$locale string
$includes array
return Sulu\Bundle\ContactBundle\Api\Account

getByIds() public method

Returns account entities by ids.
public getByIds ( array $ids, string $locale ) : array
$ids array
$locale string
return array

removeAddressRelation() public method

Removes the address relation from a contact and also deletes the address if it has no more relations.
public removeAddressRelation ( Sulu\Bundle\ContactBundle\Entity\AccountInterface $account, AccountAddress $accountAddress ) : mixed | void
$account Sulu\Bundle\ContactBundle\Entity\AccountInterface
$accountAddress Sulu\Bundle\ContactBundle\Entity\AccountAddress
return mixed | void

setMedias() public method

Currently associated medias are replaced.
public setMedias ( Sulu\Bundle\ContactBundle\Entity\Account $account, $medias )
$account Sulu\Bundle\ContactBundle\Entity\Account
$medias

Property Details

$addressEntity protected_oe property

protected $addressEntity

$mediaRepository protected_oe property

protected MediaRepositoryInterface,Sulu\Bundle\MediaBundle\Entity $mediaRepository
return Sulu\Bundle\MediaBundle\Entity\MediaRepositoryInterface