findByAccountId() public method

public findByAccountId ( $accountId, $excludeContactId = null, $arrayResult = true, $onlyFetchMainAccounts = true )
Exemplo n.º 1
0
 /**
  * Returns contacts by account id.
  *
  * @param $id
  * @param $locale
  * @param bool $onlyFetchMainAccounts
  *
  * @return array|null
  */
 public function findContactsByAccountId($id, $locale, $onlyFetchMainAccounts = false)
 {
     $contactsEntities = $this->contactRepository->findByAccountId($id, null, false, $onlyFetchMainAccounts);
     if (!empty($contactsEntities)) {
         $contacts = [];
         foreach ($contactsEntities as $contact) {
             $contacts[] = new Contact($contact, $locale, $this->tagManager);
         }
         return $contacts;
     }
     return;
 }