addAccountContact() public method

Add account contact.
public addAccountContact ( AccountContact $accountContact ) : Sulu\Component\Contact\Model\ContactInterface
$accountContact Sulu\Bundle\ContactBundle\Entity\AccountContact
return Sulu\Component\Contact\Model\ContactInterface
Esempio n. 1
0
 /**
  * Creates account contact relation.
  *
  * @param AccountInterface $account
  * @param ContactInterface $contact
  * @param bool $isMain
  *
  * @return AccountContact
  */
 protected function createAccountContact(AccountInterface $account, ContactInterface $contact, $isMain = true)
 {
     $accountContact = new AccountContact();
     $accountContact->setAccount($account);
     $accountContact->setContact($contact);
     $accountContact->setMain($isMain);
     $this->contact->addAccountContact($accountContact);
     $this->em->persist($accountContact);
     return $accountContact;
 }