Merge errors from all
@inheritdoc
426900
public function getErrors($attribute = null)
    {
        $itemErrors = [];

        foreach ($this->getItems() as $item) {
            if ($item->hasErrors($attribute)) {
                $itemErrors[$this->getItemId($item)] = $item->getErrors($attribute);
            }
        }

        return array_merge(
            $this->_traitGetErrors($attribute),
            $itemErrors
        );
    }
432941
public function combine() {

		$fieldnames = func_get_args();
		$values 	= [];

		foreach($fieldnames as $fieldname) {

			if(false === is_string($fieldname)) {
				return trigger_error(sprintf('All fieldnames used in "%s"() must be of the type string, "%s" given', __METHOD__, gettype($fieldname)), E_USER_ERROR);
			}

			$values[] = $this -> getValue($fieldname, $this -> getPrefix());
		}

		$combine = new Combine();
		$combine -> setValues($values);
		$combine -> setFieldnames($fieldnames);

		$this -> combine[] = $combine;

		return $combine;
	}
1281663
protected function errors(array $errors): array
    {
        $final = [];
        foreach ($errors as $errorId => $details) {
            if ($details instanceOf ParamError) {
                $final[$errorId] = $details;
            } else {
                $final[$errorId] = ParamError::fromData($errorId, $details);
            }
        }

        return [null, $final];
    }
14687
public function getErrors(): array {
        $result = [];
        foreach ($this->getRawErrors() as $field => $error) {
            $result[] = $this->pluckError(['field' => $field] + $error);
        }
        return $result;
    }
515402
static function flattenErrors($obj, $key = '') {
        $messages = array();
        
        foreach($obj as $k => $val) {
            if($k === 'message') {
                continue;
            }
            
            $newKey = $k;
            if($key) {
                if(\is_numeric($k)) {
                    $newKey = $key.'.'.$k;
                } else {
                    $newKey = $key.'['.$k.']';
                }
            }
            
            if(isset($val['_errors'])) {
                $messages[] = $newKey.': '.\implode(' ', \array_map(function ($element) {
                    return $element['message'];
                }, $val['_errors']));
            } else if(isset($val['code']) || isset($val['message'])) {
                $messages[] = \trim(($val['code'] ?? '').': '.($val['message'] ?? ''));
            } else if(\is_array($val)) {
                $messages = \array_merge($messages, self::flattenErrors($val, $newKey));
            } else {
                $messages[] = $val;
            }
        }

        return $messages;
    }
553741
def merge!(errors)
      if errors
        errors.each_pair do |field, messages|
          messages.each do |message|
            add(field, message)
          end
        end
      end
    end
1001926
function(err) {
    var validationErrMsg = self.handleError(err)
    if (!validationErrMsg) return false
    else { 
      self._merge(validationErrors, validationErrMsg, prefix)
      isValid = false
      return true
    }
  }
616436
function $merge(params, fn) {
    if (
        Array.isArray(params) &&
        params.length === 2 &&
        params.every(p => typeof p === 'object')
    ) {
        return fn.merge(params[0], params[1]);
    }
    throw new Error('$merge expects an array of two objects');
}
261707
private function appendErrorsSchema(MethodDoc $docObject) : array
    {
        $docArray = [];
        // Create custom result schema only if provided
        if (count($docObject->getCustomErrorList()) || count($docObject->getGlobalErrorRefList())) {
            $docArray['errors'] = array_merge(
                array_map(
                    [$this->errorDocNormalizer, 'normalize'],
                    $docObject->getCustomErrorList()
                ),
                array_map(
                    function ($errorIdentifier) {
                        return ['$ref' => sprintf('#/errors/%s', $errorIdentifier)];
                    },
                    $docObject->getGlobalErrorRefList()
                )
            );
        }

        return $docArray;
    }
593435
protected function formatErrors(string $errors)
    {
        $errors = json_decode($errors);
        $output = '';

        foreach ($errors as $error)
            foreach ($error as $message)
                $output .= $message . "\r\n";

        return $output;
    }
703071
public function addError(...$args) {
        $args = func_get_args();
        if(func_num_args()>2){
            foreach ($args as $error) {
                array_push($this->errors, $error);
            }
        } else {
            if(func_get_args()==1) {
                $this->errors[] = $args[0];
            } else {
                $this->errors[$args[0]] = $args[1];
            }
        }
    }
38854
public function appendCollectionAttributes(
        array $data,
        ErrorCollection $error,
        string $format,
        array $context
    ): array {
        $innerError = new ErrorResource(
            $error->getMessage(),
            $error->getReason(),
            $error->getPath(),
            $error->getAttributes(),
            $error->getIdentifier()
        );

        foreach ($error->getRelations() as $relation) {
            $innerError->addRelation($relation);
        }

        $normalizedInnerError = $this->normalizer->normalize($innerError, $format, $context);

        return array_merge($normalizedInnerError, $data);
    }
363834
protected function buildErrors()
    {
        if ($this->hasErrors()) {
            echo implode(PHP_EOL, $this->getErrors());
            echo PHP_EOL, $this->opts->getUsageMessage();
        }

        return $this;
    }
94957
protected function redefineErrorHandlers(&$container)
    {
        // Redefine - errors
        $container['errorHandler'] = BuilderJsonErrorResponses::jsonError();
        $container['phpErrorHandler'] = BuilderJsonErrorResponses::jsonPhpError();
        $container['notFoundHandler'] = BuilderJsonErrorResponses::jsonNotFound();
        $container['notAllowedHandler'] = BuilderJsonErrorResponses::jsonNotAllowed();
    }
487129
public function getFieldErrors(string $field): array {
        if (empty($this->errors[$field])) {
            return [];
        } else {
            $result = [];
            foreach ($this->errors[$field] as $error) {
                $result[] = $this->pluckError($error + ['field' => $field]);
            }
            return $result;
        }
    }
1342443
function MergeDone($srcTable, $dstTable, $pkeys, $srcignoreflds, $setsrc,
		$srcUpdateDateFld,
		$srcCopyFlagFld,  $flagvals=array('Y','N','P','='),
		$srcCopyDateFld = false,
		$dstCopyDateFld = false,
		$whereClauses = '',
		$orderBy = '', # MUST INCLUDE THE "ORDER BY" suffix
		$copyDoneFlagIdx = 2,
		$defaultDestRaiseErrorFn = '')
	{
		return  $this->Merge($srcTable, $dstTable, $pkeys, $srcignoreflds, $setsrc,
		$srcUpdateDateFld,
		$srcCopyFlagFld,  $flagvals,
		$srcCopyDateFld,
		$dstCopyDateFld,
		$whereClauses,
		$orderBy, # MUST INCLUDE THE "ORDER BY" suffix
		$copyDoneFlagIdx,
		$defaultDestRaiseErrorFn);
	}
1315394
public function merge($values): Map
    {
        $merged = new self($this);
        $merged->putAll($values);
        return $merged;
    }