Sulu\Bundle\ContactBundle\Contact\AbstractContactManager::processBankAccounts PHP Méthode

processBankAccounts() public méthode

Process all bankAccounts of a request.
public processBankAccounts ( $contact, $bankAccounts ) : boolean
$contact
$bankAccounts
Résultat boolean True if the processing was sucessful, otherwise false
    public function processBankAccounts($contact, $bankAccounts)
    {
        $get = function ($bankAccount) {
            return $bankAccount->getId();
        };
        $delete = function ($bankAccounts) use($contact) {
            $contact->removeBankAccount($bankAccounts);
            return true;
        };
        $update = function ($bankAccounts, $matchedEntry) {
            return $this->updateBankAccount($bankAccounts, $matchedEntry);
        };
        $add = function ($bankAccounts) use($contact) {
            return $this->addBankAccount($contact, $bankAccounts);
        };
        $entities = $contact->getBankAccounts();
        $result = $this->processSubEntities($entities, $bankAccounts, $get, $add, $update, $delete);
        $this->resetIndexOfSubentites($entities);
        return $result;
    }