src/Phpforce/SoapClient/Client.php
protected function checkResult(array $results, array $params)
    {
        $exceptions = new Exception\SaveException();

        for ($i = 0; $i < count($results); $i++) {

            // If the param was an (s)object, set it’s Id field
            if (is_object($params[$i])
                && (!isset($params[$i]->Id) || null === $params[$i]->Id)
                && $results[$i] instanceof Result\SaveResult) {
                $params[$i]->Id = $results[$i]->getId();
            }

            if (!$results[$i]->isSuccess()) {
                $results[$i]->setParam($params[$i]);
                $exceptions->add($results[$i]);
            }
        }

        if ($exceptions->count() > 0) {
            throw $exceptions;
        }

        return $results;
    }
protected function checkResult(array $results, array $params)
    {
        $exceptions = new Exception\SaveException();

        for ($i = 0; $i < count($results); $i++) {

            // If the param was an (s)object, set it’s Id field
            if (is_object($params[$i])
                && (!isset($params[$i]->Id) || null === $params[$i]->Id)
                && $results[$i] instanceof Result\SaveResult) {
                $params[$i]->Id = $results[$i]->getId();
            }

            if (!$results[$i]->isSuccess()) {
                $results[$i]->setParam($params[$i]);
                $exceptions->add($results[$i]);
            }
        }

        if ($exceptions->count() > 0) {
            throw $exceptions;
        }

        return $results;
    }
protected function checkResult ( array $ results , array $ params ) { $ exceptions = new Exception \ SaveException ( ) ; for ( $ i = 0 ; $ i < count ( $ results ) ; $ i ++ ) { // If the param was an (s)object, set it’s Id field if ( is_object ( $ params [ $ i ] ) && ( ! isset ( $ params [ $ i ] -> Id ) || null === $ params [ $ i ] -> Id ) && $ results [ $ i ] instanceof Result \ SaveResult ) { $ params [ $ i ] -> Id = $ results [ $ i ] -> getId ( ) ; } if ( ! $ results [ $ i ] -> isSuccess ( ) ) { $ results [ $ i ] -> setParam ( $ params [ $ i ] ) ; $ exceptions -> add ( $ results [ $ i ] ) ; } } if ( $ exceptions -> count ( ) > 0 ) { throw $ exceptions ; } return $ results ; }
Check response for errors

Add each submitted object to its corresponding success or error message

@param array $results Results
@param array $params  Parameters

@throws Exception\SaveException  When Salesforce returned an error
@return array
Check response for errors