src/Exception/ValidationException.php
public function merge(ValidationException $object, $hasMany = false)
    {
        $alias = $object->alias();

        // We will need this when generating errors
        $this->_objects[ $alias ]['_hasMany'] = (false !== $hasMany);

        if (true === $hasMany)
        {
            // This is most likely a hasMany relationship
            $this->_objects[ $alias ][] = $object->objects();
        }
        elseif ($hasMany)
        {
            // This is most likely a hasMany relationship
            $this->_objects[ $alias ][ $hasMany ] = $object->objects();
        }
        else
        {
            $this->_objects[ $alias ] = $object->objects();
        }

        return $this;
    }
public function merge(ValidationException $object, $hasMany = false)
    {
        $alias = $object->alias();

        // We will need this when generating errors
        $this->_objects[ $alias ]['_hasMany'] = (false !== $hasMany);

        if (true === $hasMany)
        {
            // This is most likely a hasMany relationship
            $this->_objects[ $alias ][] = $object->objects();
        }
        elseif ($hasMany)
        {
            // This is most likely a hasMany relationship
            $this->_objects[ $alias ][ $hasMany ] = $object->objects();
        }
        else
        {
            $this->_objects[ $alias ] = $object->objects();
        }

        return $this;
    }
public function merge ( ValidationException $ object , $ hasMany = false ) { $ alias = $ object -> alias ( ) ; // We will need this when generating errors $ this -> _objects [ $ alias ] [ '_hasMany' ] = ( false !== $ hasMany ) ; if ( true === $ hasMany ) { // This is most likely a hasMany relationship $ this -> _objects [ $ alias ] [ ] = $ object -> objects ( ) ; } elseif ( $ hasMany ) { // This is most likely a hasMany relationship $ this -> _objects [ $ alias ] [ $ hasMany ] = $ object -> objects ( ) ; } else { $ this -> _objects [ $ alias ] = $ object -> objects ( ) ; } return $ this ; }
Merges an ValidationException object into the current exception
Useful when you want to combine errors into one array

@param  ValidationException $object  The exception to merge
@param  mixed               $hasMany The array key to use if this exception can be merged multiple times
@return ValidationException
Merges an ValidationException object into the current exception Useful when you want to combine errors into one array