/** * Find consolidator for account by account object * * @param ClientAccount $account * @return null|ClientAccount */ public function findConsolidatorForAccount(ClientAccount $account) { $clientId = $account->getClientId() ? $account->getClientId() : $account->getClient()->getId(); return $this->findConsolidatorByClientIdAndSystemTypeAndOwnersAndNotId($clientId, $account->getSystemType(), $account->getOwnersAsArray(), $account->getId()); }