Domain/Domain.php
protected function doPersistList(ResourceListInterface $resources, $autoCommit, $type)
    {
        $hasError = false;
        $hasFlushError = false;

        foreach ($resources as $i => $resource) {
            if (!$autoCommit && $hasError) {
                $resource->setStatus(ResourceStatutes::CANCELED);
            } elseif ($autoCommit && $hasFlushError && $hasError) {
                DomainUtil::addResourceError($resource, $this->translator->trans('domain.database_previous_error', [], 'FxpResource'));
            } else {
                list($successStatus, $hasFlushError) = $this->doPersistResource($resource, $autoCommit, $type);
                $hasError = $this->finalizeResourceStatus($resource, $successStatus, $hasError);
            }
        }

        return $hasError;
    }
protected function doPersistList(ResourceListInterface $resources, $autoCommit, $type)
    {
        $hasError = false;
        $hasFlushError = false;

        foreach ($resources as $i => $resource) {
            if (!$autoCommit && $hasError) {
                $resource->setStatus(ResourceStatutes::CANCELED);
            } elseif ($autoCommit && $hasFlushError && $hasError) {
                DomainUtil::addResourceError($resource, $this->translator->trans('domain.database_previous_error', [], 'FxpResource'));
            } else {
                list($successStatus, $hasFlushError) = $this->doPersistResource($resource, $autoCommit, $type);
                $hasError = $this->finalizeResourceStatus($resource, $successStatus, $hasError);
            }
        }

        return $hasError;
    }
protected function doPersistList ( ResourceListInterface $ resources , $ autoCommit , $ type ) { $ hasError = false ; $ hasFlushError = false ; foreach ( $ resources as $ i => $ resource ) { if ( ! $ autoCommit && $ hasError ) { $ resource -> setStatus ( ResourceStatutes :: CANCELED ) ; } elseif ( $ autoCommit && $ hasFlushError && $ hasError ) { DomainUtil :: addResourceError ( $ resource , $ this -> translator -> trans ( 'domain.database_previous_error' , [ ] , 'FxpResource' ) ) ; } else { list ( $ successStatus , $ hasFlushError ) = $ this -> doPersistResource ( $ resource , $ autoCommit , $ type ) ; $ hasError = $ this -> finalizeResourceStatus ( $ resource , $ successStatus , $ hasError ) ; } } return $ hasError ; }
Do persist the resources.

@param ResourceListInterface $resources  The list of object resource instance
@param bool                  $autoCommit Commit transaction for each resource or all
(continue the action even if there is an error on a resource)
@param int                   $type       The type of persist action

@return bool Check if there is an error in list
Do persist the resources .