PHP Класс Sulu\Bundle\ContactBundle\Contact\AccountManager

Наследование: extends AbstractContactManager, implements Sulu\Component\SmartContent\Orm\DataProviderRepositoryInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$addressEntity
$mediaRepository Sulu\Bundle\MediaBundle\Entity\MediaRepositoryInterface

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
getApiObject ( Sulu\Bundle\ContactBundle\Entity\Account $account, string $locale ) : Account Takes a account entity and a locale and returns the api object.

Описание методов

__construct() публичный Метод

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() публичный Метод

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
Результат Sulu\Bundle\ContactBundle\Entity\AccountAddress

deleteAllRelations() публичный Метод

public deleteAllRelations ( $entity )

deleteBankAccounts() публичный Метод

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

findAll() публичный Метод

Returns all accounts.
public findAll ( string $locale, null $filter = null ) : array | null
$locale string
$filter null
Результат array | null

findByFilters() публичный Метод

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

findContactsByAccountId() публичный Метод

Returns contacts by account id.
public findContactsByAccountId ( integer $id, string $locale, boolean $onlyFetchMainAccounts = false ) : array | null
$id integer
$locale string
$onlyFetchMainAccounts boolean
Результат array | null

getAccount() публичный Метод

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
Результат null | Sulu\Bundle\ContactBundle\Api\Account

getAddressRelations() публичный Метод

Returns a collection of relations to get addresses.
public getAddressRelations ( $entity ) : mixed
$entity
Результат mixed

getApiObject() защищенный Метод

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
Результат Sulu\Bundle\ContactBundle\Api\Account

getById() публичный Метод

Gets account by id.
public getById ( integer $id, string $locale ) : mixed
$id integer
$locale string
Результат mixed

getByIdAndInclude() публичный Метод

Gets account by id - can include relations.
public getByIdAndInclude ( integer $id, string $locale, array $includes ) : Account
$id integer
$locale string
$includes array
Результат Sulu\Bundle\ContactBundle\Api\Account

getByIds() публичный Метод

Returns account entities by ids.
public getByIds ( array $ids, string $locale ) : array
$ids array
$locale string
Результат array

removeAddressRelation() публичный Метод

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
Результат mixed | void

setMedias() публичный Метод

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

Описание свойств

$addressEntity защищенное свойство

protected $addressEntity

$mediaRepository защищенное свойство

protected MediaRepositoryInterface,Sulu\Bundle\MediaBundle\Entity $mediaRepository
Результат Sulu\Bundle\MediaBundle\Entity\MediaRepositoryInterface