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

Наследование: implements Sulu\Bundle\ContactBundle\Contact\ContactManagerInterface, use trait Sulu\Component\Persistence\RelationTrait
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$accountContactEntityName
$addressEntityName
$addressTypeEntityName
$categoryEntityName
$countryEntityName
$em Doctrine\Common\Persistence\ObjectManager
$emailEntityName
$emailTypeEntityName
$faxTypeEntityName
$mediaManager Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface
$phoneEntityName
$phoneTypeEntityName
$positionEntityName
$tagManager Sulu\Bundle\TagBundle\Tag\TagManagerInterface
$urlEntityName
$urlTypeEntityName

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

Метод Описание
__construct ( Doctrine\Common\Persistence\ObjectManager $em, Sulu\Bundle\TagBundle\Tag\TagManagerInterface $tagManager, Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface $mediaManager )
addNewContactRelations ( Contact $contact, array $data ) adds new relations.
contactIsEmployeeOfAccount ( $contact, $account ) : boolean checks if an account is employee of a company.
createMainAccountContact ( Contact $contact, Sulu\Bundle\ContactBundle\Entity\AccountInterface $account, $position = null ) : AccountContact creates a new main Account Contacts relation.
deleteAddresses ( $entity ) deletes all addresses that are assigned to entity.
deleteAllRelations ( $entity ) clears all relational data from entity and deletes it.
deleteEmails ( $entity ) deletes all emails that are assigned to entity.
deleteFaxes ( $entity ) deletes all faxes that are assigned to entity.
deleteNotes ( $entity ) deletes all notes that are assigned to entity.
deletePhones ( $entity ) deletes all phones that are assigned to entity.
deleteUrls ( $entity ) deletes all urls that are assigned to entity.
getAccounContact ( Sulu\Bundle\ContactBundle\Entity\AccountInterface $account, Contact $contact ) : null | AccountContact Returns AccountContact relation if exists.
getAddressByCondition ( Sulu\Bundle\ContactBundle\Entity\AccountInterface | Contact $entity, callable $conditionCallback, boolean $force = false ) : mixed Returns an address by callback-condition.
getAddressTypeByName ( $name ) : mixed return address type by name.
getBillingAddress ( Sulu\Bundle\ContactBundle\Entity\AccountInterface | Contact $entity, boolean $force = false ) : mixed Returns the billing address of an account/contact.
getDeliveryAddress ( Sulu\Bundle\ContactBundle\Entity\AccountInterface | Contact $entity, boolean $force = false ) : mixed Returns the delivery address.
getEmailTypeByName ( $name ) : mixed return email type by name.
getFaxTypeByName ( $name ) : mixed return fax type by name.
getMainAccountContact ( Contact | Sulu\Bundle\ContactBundle\Entity\AccountInterface $contact ) : AccountContact | boolean returns the main account-contact relation.
getPhoneTypeByName ( $name ) : mixed return phone type by name.
getPosition ( $data ) : mixed Get a position object.
getTagManager ( ) : Sulu\Bundle\TagBundle\Tag\TagManagerInterface Returns the tag manager.
getUrlTypeByName ( $name ) : mixed return url type by name.
processAddresses ( $contact, array $addresses ) : boolean Process all addresses from request.
processBankAccounts ( $contact, $bankAccounts ) : boolean Process all bankAccounts of a request.
processCategories ( $contact, $categories ) : boolean Process all categories of request.
processEmails ( $contact, $emails ) : boolean Process all emails from request.
processFaxes ( $contact, array $faxes ) : boolean
processNotes ( Contact $contact, $notes ) : boolean Process all notes from request.
processPhones ( $contact, $phones ) : boolean Process all phones from request.
processTags ( $contact, array $tags ) : boolean Process all tags of request.
processUrls ( $contact, array $urls ) : boolean Process all urls of request.
setMainEmail ( Contact | Sulu\Bundle\ContactBundle\Entity\AccountInterface $entity ) sets Entity's Main-Email.
setMainFax ( Contact | Sulu\Bundle\ContactBundle\Entity\AccountInterface $entity ) sets Entity's Main-Fax.
setMainForCollection ( $arrayCollection ) sets the first element to main, if none is set.
setMainPhone ( Contact | Sulu\Bundle\ContactBundle\Entity\AccountInterface $entity ) sets Entity's Main-Phone.
setMainUrl ( Contact | Sulu\Bundle\ContactBundle\Entity\AccountInterface $entity ) sets Entity's Main-Url.
unsetMain ( $arrayCollection ) : boolean unsets main of all elements of an ArrayCollection | PersistanceCollection.

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

Метод Описание
addBankAccount ( $contact, $data ) : boolean Add a new note to the given contact and persist it with the given object manager.
addCategories ( $contact, $data ) : boolean Adds a new category to the given contact.
addEmail ( Contact $contact, array $emailData ) : boolean Adds a new email to the given contact and persist it with the given object manager.
addFax ( $contact, array $faxData )
addNote ( $contact, array $noteData ) : boolean Add a new note to the given contact and persist it with the given object manager.
addPhone ( $contact, array $phoneData ) : boolean Add a new phone to the given contact and persist it with the given object manager.
addTag ( $contact, $data ) : boolean Adds a new tag to the given contact and persist it with the given object manager.
addUrl ( $contact, $data ) : boolean Adds a new tag to the given contact.
checkAndSetMainAddress ( $addresses ) : mixed sets main address.
createAddress ( array $addressData, &$isMain = null ) : Address Creates an address based on the data passed.
deleteAllEntitiesOfCollection ( $arrayCollection )
getBooleanValue ( $value ) : boolean Checks if a value is a boolean and converts it if necessary and returns it.
updateAddress ( Address $address, mixed $entry, boolean &$isMain = null ) : boolean Updates the given address.
updateBankAccount ( BankAccount $entity, string $data ) : boolean Updates the given note.
updateEmail ( Email $email, array $entry ) : boolean Updates the given email address.
updateFax ( Fax $fax, $entry ) : boolean
updateNote ( Note $note, array $entry ) : boolean Updates the given note.
updatePhone ( Phone $phone, $entry ) : boolean Updates the given phone.
updateUrl ( Url $url, $entry ) : boolean

Приватные методы

Метод Описание
getAddresses ( Sulu\Bundle\ContactBundle\Entity\AccountInterface | Contact $entity ) : Doctrine\Common\Collections\Collection | null returns addresses from account or contact.
getProperty ( array $data, string $key, string $default = null ) : string | null Return property for key or given default value.
hasMain ( $arrayCollection, &$mainEntity = null ) : mixed checks if a collection for main attribute.
resetIndexOfSubentites ( mixed $entities ) TODO: this is just a hack to avoid relations that start with index != 0 otherwise deserialization process will parse relations as object instead of an array reindex entities.

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

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

public __construct ( Doctrine\Common\Persistence\ObjectManager $em, Sulu\Bundle\TagBundle\Tag\TagManagerInterface $tagManager, Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface $mediaManager )
$em Doctrine\Common\Persistence\ObjectManager
$tagManager Sulu\Bundle\TagBundle\Tag\TagManagerInterface
$mediaManager Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface

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

Add a new note to the given contact and persist it with the given object manager.
protected addBankAccount ( $contact, $data ) : boolean
$contact
$data
Результат boolean

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

Adds a new category to the given contact.
protected addCategories ( $contact, $data ) : boolean
$contact
$data
Результат boolean

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

Adds a new email to the given contact and persist it with the given object manager.
protected addEmail ( Contact $contact, array $emailData ) : boolean
$contact Sulu\Bundle\ContactBundle\Entity\Contact
$emailData array
Результат boolean

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

protected addFax ( $contact, array $faxData )
$contact
$faxData array

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

adds new relations.
public addNewContactRelations ( Contact $contact, array $data )
$contact Sulu\Bundle\ContactBundle\Entity\Contact
$data array

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

Add a new note to the given contact and persist it with the given object manager.
protected addNote ( $contact, array $noteData ) : boolean
$contact
$noteData array
Результат boolean True if there was no error, otherwise false

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

Add a new phone to the given contact and persist it with the given object manager.
protected addPhone ( $contact, array $phoneData ) : boolean
$contact
$phoneData array
Результат boolean True if there was no error, otherwise false

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

Adds a new tag to the given contact and persist it with the given object manager.
protected addTag ( $contact, $data ) : boolean
$contact
$data
Результат boolean True if there was no error, otherwise false

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

Adds a new tag to the given contact.
protected addUrl ( $contact, $data ) : boolean
$contact
$data
Результат boolean

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

sets main address.
protected checkAndSetMainAddress ( $addresses ) : mixed
$addresses
Результат mixed

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

checks if an account is employee of a company.
public contactIsEmployeeOfAccount ( $contact, $account ) : boolean
$contact
$account
Результат boolean

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

Creates an address based on the data passed.
protected createAddress ( array $addressData, &$isMain = null ) : Address
$addressData array
$isMain returns if address is main address
Результат Sulu\Bundle\ContactBundle\Entity\Address

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

creates a new main Account Contacts relation.
public createMainAccountContact ( Contact $contact, Sulu\Bundle\ContactBundle\Entity\AccountInterface $account, $position = null ) : AccountContact
$contact Sulu\Bundle\ContactBundle\Entity\Contact
$account Sulu\Bundle\ContactBundle\Entity\AccountInterface
$position
Результат Sulu\Bundle\ContactBundle\Entity\AccountContact

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

deletes all addresses that are assigned to entity.
public deleteAddresses ( $entity )
$entity

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

protected deleteAllEntitiesOfCollection ( $arrayCollection )
$arrayCollection

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

clears all relational data from entity and deletes it.
public deleteAllRelations ( $entity )
$entity

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

deletes all emails that are assigned to entity.
public deleteEmails ( $entity )
$entity

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

deletes all faxes that are assigned to entity.
public deleteFaxes ( $entity )
$entity

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

deletes all notes that are assigned to entity.
public deleteNotes ( $entity )
$entity

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

deletes all phones that are assigned to entity.
public deletePhones ( $entity )
$entity

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

deletes all urls that are assigned to entity.
public deleteUrls ( $entity )
$entity

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

Returns AccountContact relation if exists.
public getAccounContact ( Sulu\Bundle\ContactBundle\Entity\AccountInterface $account, Contact $contact ) : null | AccountContact
$account Sulu\Bundle\ContactBundle\Entity\AccountInterface
$contact Sulu\Bundle\ContactBundle\Entity\Contact
Результат null | Sulu\Bundle\ContactBundle\Entity\AccountContact

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

Returns an address by callback-condition.
public getAddressByCondition ( Sulu\Bundle\ContactBundle\Entity\AccountInterface | Contact $entity, callable $conditionCallback, boolean $force = false ) : mixed
$entity Sulu\Bundle\ContactBundle\Entity\AccountInterface | Sulu\Bundle\ContactBundle\Entity\Contact
$conditionCallback callable
$force boolean Forces function to return an address if any address is defined if no delivery address is defined it will first return the main address then any
Результат mixed

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

return address type by name.
public getAddressTypeByName ( $name ) : mixed
$name
Результат mixed

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

Returns the billing address of an account/contact.
public getBillingAddress ( Sulu\Bundle\ContactBundle\Entity\AccountInterface | Contact $entity, boolean $force = false ) : mixed
$entity Sulu\Bundle\ContactBundle\Entity\AccountInterface | Sulu\Bundle\ContactBundle\Entity\Contact
$force boolean Forces function to return an address if any address is defined if no delivery address is defined it will first return the main address then any
Результат mixed

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

Checks if a value is a boolean and converts it if necessary and returns it.
protected getBooleanValue ( $value ) : boolean
$value
Результат boolean

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

Returns the delivery address.
public getDeliveryAddress ( Sulu\Bundle\ContactBundle\Entity\AccountInterface | Contact $entity, boolean $force = false ) : mixed
$entity Sulu\Bundle\ContactBundle\Entity\AccountInterface | Sulu\Bundle\ContactBundle\Entity\Contact
$force boolean Forces function to return an address if any address is defined if no delivery address is defined it will first return the main address then any
Результат mixed

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

return email type by name.
public getEmailTypeByName ( $name ) : mixed
$name
Результат mixed

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

return fax type by name.
public getFaxTypeByName ( $name ) : mixed
$name
Результат mixed

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

returns the main account-contact relation.
public getMainAccountContact ( Contact | Sulu\Bundle\ContactBundle\Entity\AccountInterface $contact ) : AccountContact | boolean
$contact Sulu\Bundle\ContactBundle\Entity\Contact | Sulu\Bundle\ContactBundle\Entity\AccountInterface
Результат Sulu\Bundle\ContactBundle\Entity\AccountContact | boolean

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

return phone type by name.
public getPhoneTypeByName ( $name ) : mixed
$name
Результат mixed

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

Get a position object.
public getPosition ( $data ) : mixed
Результат mixed

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

Returns the tag manager.
public getTagManager ( ) : Sulu\Bundle\TagBundle\Tag\TagManagerInterface
Результат Sulu\Bundle\TagBundle\Tag\TagManagerInterface

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

return url type by name.
public getUrlTypeByName ( $name ) : mixed
$name
Результат mixed

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

Process all addresses from request.
public processAddresses ( $contact, array $addresses ) : boolean
$contact The contact on which is worked
$addresses array
Результат boolean True if the processing was sucessful, otherwise false

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

Process all bankAccounts of a request.
public processBankAccounts ( $contact, $bankAccounts ) : boolean
$contact
$bankAccounts
Результат boolean True if the processing was sucessful, otherwise false

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

Process all categories of request.
public processCategories ( $contact, $categories ) : boolean
$contact - the contact which is processed
$categories
Результат boolean True if the processing was successful, otherwise false

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

Process all emails from request.
public processEmails ( $contact, $emails ) : boolean
$contact The contact on which is worked
$emails
Результат boolean True if the processing was successful, otherwise false

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

public processFaxes ( $contact, array $faxes ) : boolean
$contact
$faxes array
Результат boolean

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

Process all notes from request.
public processNotes ( Contact $contact, $notes ) : boolean
$contact Sulu\Bundle\ContactBundle\Entity\Contact The contact on which is worked
$notes
Результат boolean True if the processing was successful, otherwise false

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

Process all phones from request.
public processPhones ( $contact, $phones ) : boolean
$contact The contact on which is processed
$phones
Результат boolean True if the processing was successful, otherwise false

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

Process all tags of request.
public processTags ( $contact, array $tags ) : boolean
$contact The contact on which is worked
$tags array
Результат boolean True if the processing was successful, otherwise false

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

Process all urls of request.
public processUrls ( $contact, array $urls ) : boolean
$contact The contact to be processed
$urls array
Результат boolean True if the processing was successful, otherwise false

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

sets Entity's Main-Email.
public setMainEmail ( Contact | Sulu\Bundle\ContactBundle\Entity\AccountInterface $entity )
$entity Sulu\Bundle\ContactBundle\Entity\Contact | Sulu\Bundle\ContactBundle\Entity\AccountInterface

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

sets Entity's Main-Fax.
public setMainFax ( Contact | Sulu\Bundle\ContactBundle\Entity\AccountInterface $entity )
$entity Sulu\Bundle\ContactBundle\Entity\Contact | Sulu\Bundle\ContactBundle\Entity\AccountInterface

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

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

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

sets Entity's Main-Phone.
public setMainPhone ( Contact | Sulu\Bundle\ContactBundle\Entity\AccountInterface $entity )
$entity Sulu\Bundle\ContactBundle\Entity\Contact | Sulu\Bundle\ContactBundle\Entity\AccountInterface

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

sets Entity's Main-Url.
public setMainUrl ( Contact | Sulu\Bundle\ContactBundle\Entity\AccountInterface $entity )
$entity Sulu\Bundle\ContactBundle\Entity\Contact | Sulu\Bundle\ContactBundle\Entity\AccountInterface

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

unsets main of all elements of an ArrayCollection | PersistanceCollection.
public unsetMain ( $arrayCollection ) : boolean
$arrayCollection
Результат boolean returns true if a element was unset

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

Updates the given address.
protected updateAddress ( Address $address, mixed $entry, boolean &$isMain = null ) : boolean
$address Sulu\Bundle\ContactBundle\Entity\Address The phone object to update
$entry mixed The entry with the new data
$isMain boolean returns if address should be set to main
Результат boolean True if successful, otherwise false

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

Updates the given note.
protected updateBankAccount ( BankAccount $entity, string $data ) : boolean
$entity Sulu\Bundle\ContactBundle\Entity\BankAccount The phone object to update
$data string The entry with the new data
Результат boolean True if successful, otherwise false

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

Updates the given email address.
protected updateEmail ( Email $email, array $entry ) : boolean
$email Sulu\Bundle\ContactBundle\Entity\Email The email object to update
$entry array The entry with the new data
Результат boolean True if successful, otherwise false

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

protected updateFax ( Fax $fax, $entry ) : boolean
$fax Sulu\Bundle\ContactBundle\Entity\Fax
$entry
Результат boolean

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

Updates the given note.
protected updateNote ( Note $note, array $entry ) : boolean
$note Sulu\Bundle\ContactBundle\Entity\Note
$entry array The entry with the new data
Результат boolean True if successful, otherwise false

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

Updates the given phone.
protected updatePhone ( Phone $phone, $entry ) : boolean
$phone Sulu\Bundle\ContactBundle\Entity\Phone The phone object to update
$entry The entry with the new data
Результат boolean True if successful, otherwise false

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

protected updateUrl ( Url $url, $entry ) : boolean
$url Sulu\Bundle\ContactBundle\Entity\Url
$entry
Результат boolean

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

$accountContactEntityName защищенное статическое свойство

protected static $accountContactEntityName

$addressEntityName защищенное статическое свойство

protected static $addressEntityName

$addressTypeEntityName защищенное статическое свойство

protected static $addressTypeEntityName

$categoryEntityName защищенное статическое свойство

protected static $categoryEntityName

$countryEntityName защищенное статическое свойство

protected static $countryEntityName

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

protected ObjectManager,Doctrine\Common\Persistence $em
Результат Doctrine\Common\Persistence\ObjectManager

$emailEntityName защищенное статическое свойство

protected static $emailEntityName

$emailTypeEntityName защищенное статическое свойство

protected static $emailTypeEntityName

$faxTypeEntityName защищенное статическое свойство

protected static $faxTypeEntityName

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

protected MediaManagerInterface,Sulu\Bundle\MediaBundle\Media\Manager $mediaManager
Результат Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface

$phoneEntityName защищенное статическое свойство

protected static $phoneEntityName

$phoneTypeEntityName защищенное статическое свойство

protected static $phoneTypeEntityName

$positionEntityName защищенное статическое свойство

protected static $positionEntityName

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

protected TagManagerInterface,Sulu\Bundle\TagBundle\Tag $tagManager
Результат Sulu\Bundle\TagBundle\Tag\TagManagerInterface

$urlEntityName защищенное статическое свойство

protected static $urlEntityName

$urlTypeEntityName защищенное статическое свойство

protected static $urlTypeEntityName