public function findOneHavingAccount(Account $account)
    {
        $query = $this->createQuery();

        return $query->matching($query->contains('accounts', $account))->execute()->getFirst();
    }
public function findOneHavingAccount(Account $account)
    {
        $query = $this->createQuery();

        return $query->matching($query->contains('accounts', $account))->execute()->getFirst();
    }
public function findOneHavingAccount ( Account $ account ) { $ query = $ this -> createQuery ( ) ; return $ query -> matching ( $ query -> contains ( 'accounts' , $ account ) ) -> execute ( ) -> getFirst ( ) ; }
Finds a Party instance, if any, which has the given Account attached.

@param Account $account
@return AbstractParty
Finds a Party instance if any which has the given Account attached .