Return a set of entity errors.

@return AnObjectSet
513842
public function getErrors()
    {
        if (!isset($this->_errors[$this->_mixer])) {
            $this->_errors[$this->_mixer] = new AnObjectSet();
        }

        return clone $this->_errors[$this->_mixer];
    }
825517
public function relationsErrors(\Asgard\Entity\Entity $entity, $groups=[]) {
		$data = [];
		$validator = $this->createValidator($entity);
		$validator->set('entity', $entity);
		$validator->set('dataMapper', $this);
		foreach($this->relations($this->getEntityDefinition($entity)) as $name=>$relation) {
			$data[$name] = $entity->get($name, null, false);
			$relation->prepareValidator($validator->attribute($name));
			$property = $this->getEntityDefinition($entity)->property($name);
			$validator->attribute($name)->ruleMessages($property->getMessages());
			$validator->attribute($name)->isNull(function(){return false;});
		}

		return $validator->errors($data, $groups);
	}
7853
public function getFlatErrors(): array
    {
        /**
         * Reducer that flat the errors.
         *
         * @param array   $carry previous error list
         * @param Invalid $item  to append to $carry
         *
         * @return array<Invalid>
         */
        $reduce = function(array $carry, Invalid $item) use(&$reduce) {
            if ($item instanceof self) {
                $carry = array_merge($carry, $item->getFlatErrors());
            } else {
                $carry[] = $item;
            }
            if ($item->getPrevious()) {
                $carry = $reduce($carry, $item->getPrevious());
            }

            return $carry;
        };

        return array_reduce($this->errors, $reduce, []);
    }
1015882
public function getErrorsAsArray()
    {
        $errors = array();
        $errors['HasErrors'] = $this->hasErrors();
        $errors['ErrorCount'] = $this->getErrorCount();
        $errors['Errors'] = (array)$this->errors;

        /*
        $errors['ErrorString'] = '';
        $errors['FieldErrorString'] = '';
        $errors['GlobalErrorString'] = '';
        $errors['ErrorStringHTML'] = '';
        $errors['FieldErrorStringHTML'] = '';
        $errors['GlobalErrorStringHTML'] = '';

        */

        foreach ((array)$this->errors as $err) {

            if ($err instanceof FieldValidationError) {
                $field = $err->getFieldResolved();
                $errors['Has'.$field.'Error'] = true;
                // $errors[$field.'ErrorMessage'] = $err->getDefaultErrorMessage();
                // $errors[$field.'ErrorCode'] = $err->getErrorCode();
                $errors['ErrorFields'][] = $field;
                $errors['ErrorValues'][] = $err->getValue();

                // $errors['FieldErrorString'] .= $err->getDefaultErrorMessage()."\n";
                // $errors['FieldErrorStringHTML'] .= $err->getDefaultErrorMessage().'<br/>';
            } else {
                // $errors['GlobalErrorString'] .= $err->getDefaultErrorMessage()."\n";
                // $errors['GlobalErrorStringHTML'] .= $err->getDefaultErrorMessage().'<br/>';
            }

            $errors['ErrorCodes'][] = $err->getErrorCode();
            // $errors['ErrorMessages'][] = $err->getDefaultErrorMessage();
            // $errors['ErrorString'] .= $err->getDefaultErrorMessage()."\n";
            // $errors['ErrorStringHTML'] .= $err->getDefaultErrorMessage().'<br/>';
        }

        return $errors;

    }
1324977
public function errors($options = [])
    {
        $errors = [];
        $errored = false;
        foreach ($this as $entity) {
            $result = $entity->errors($options);
            $errors[] = $result;
            if ($result) {
                $errored = true;
            }
        }
        return $errored ? $errors : [];
    }
1234143
public function errors(): ValidationErrors
    {
        $errors = new ValidationErrors();
        foreach ($this as $key => $element) {
            if ($element instanceof HasValueValidationInterface) {
                $e = $element->errors();
                if (!$e->empty()) {
                    $errors[$key] = $e;
                }
            }
        }
        return $errors;
    }
181379
public function getValidationErrors()
    {
        $errors = $this->errors;

        if (isset($this->validator)) {
            $validator_errors = $this->validator->getErrors();
            $errors = array_merge($errors, $validator_errors);
        }

        return $errors;
    }
986041
public function getErrors()
    {
        if (empty( $this->_errors )) {
            $errorList = Array();

            foreach ($this->__get(self::$ERROR) as $error) {
                $errorCode       = $error[self::$ERROR_ERROR_CODE];
                $message         = $error[self::$ERROR_MESSAGE];
                $consumerMessage = $error[self::$ERROR_CONSUMER_MESSAGE];
                $paySysMessage   = $error[self::$ERROR_PAY_SYS_MESSAGE];

                $errorObject = new WirecardCEE_QMore_Error($errorCode, $message);
                $errorObject->setPaySysMessage($paySysMessage);
                $errorObject->setConsumerMessage($consumerMessage);

                array_push($errorList, $errorObject);
            }

            $this->_errors = $errorList;
        }

        return $this->_errors;
    }
1374721
public function getErrors() {
        $result = array();

        if (count($this->errors) > 0) {
            if (isset($this->errors['common'])) {
                $result['common'] = $this->errors['common'];
            }
            if (isset($this->errors['fields'])) {
                foreach ($this->errors['fields'] as $key => $value) {
                    $result[$key] = $value;
                }
            }
        }
        
        return $result;
    }
1260036
public function getErrorMessages() {
        $messages = array();
        
        foreach($this->entries as $entry) {
            if($entry->isError()) {
                $messages[] = $entry->getMessage();
            }
        }
        
        return $messages;
    }
655474
public function getErrors()
    {
        $aErrors = Array();
        if (empty( $this->_errors )) {
            if (is_array($this->_getField(self::$ERROR))) {
                foreach ($this->_getField(self::$ERROR) as $error) {
                    $errorCode       = isset( $error[self::$ERROR_CODE] ) ? $error[self::$ERROR_CODE] : 0;
                    $message         = isset( $error[self::$ERROR_MESSAGE] ) ? $error[self::$ERROR_MESSAGE] : '';
                    $consumerMessage = isset( $error[self::$ERROR_CONSUMER_MESSAGE] ) ? $error[self::$ERROR_CONSUMER_MESSAGE] : '';
                    $paySysMessage   = isset( $error[self::$ERROR_PAYSYS_MESSAGE] ) ? $error[self::$ERROR_PAYSYS_MESSAGE] : '';

                    $error = new WirecardCEE_QMore_Error($errorCode, $message);
                    $error->setConsumerMessage($consumerMessage);
                    $error->setPaySysMessage($paySysMessage);

                    $aErrors[] = $error;
                }
            }

            $this->_errors = $aErrors;
        }

        return $this->_errors;
    }
848807
public function errors($groups=[]) {
		$data = $this->toArrayRaw();
		$validator = $this->getValidator();
		$report = $this->getDefinition()->trigger('validation', [$this, $validator, $groups, &$data], function($chain, $entity, $validator, $groups, &$data) {
			$report = $validator->errors($data, $groups);
			$report->setSelf('Entity is not valid');
			return $report;
		});

		return $report;
	}
768650
public function getValidationErrors()
    {
        $fields = $this->getFields();
        if (!$fields) {
            return [];
        }

        $result = [];
        foreach ($fields as $field) {
            if ($field instanceof AbstractFormField) {
                if (!$field->isValid()) {
                    $result = array_merge($result, $field->getErrorMessages());
                }
            }
        }

        return $result;
    }
751571
protected function getError()
	{
		return $this->form->error(
			$this->model,
			$this->attribute,
			$this->errorOptions,
			$this->enableAjaxValidation,
			$this->enableClientValidation
		);
	}
176466
public function getErrors()
    {
        $errors = array();
        /** @var \tao_helpers_form_Validator $validator */
        foreach ($this->validators as $validator) {
            $errors[] = $validator->getMessage();
        }

        return $errors;
    }
393136
public function getError()
    {
        if (count($this->errors) > 1) {
            trigger_error("There are multiple errors, returning only the first", E_USER_NOTICE);
        }
        
        return reset($this->errors) ?: null;
    }
70907
public function getErrors()
    {
        foreach ($this->errors as $i => $error) {
            if ($error instanceof \Closure) {
                $this->errors[$i] = (string) $error();
            } elseif (!\is_string($error)) {
                $this->errors[$i] = (string) $error;
            }
        }

        return $this->errors;
    }