Tells whether there are validation errors for a parameter.

@param string $key
@param string $group

@return bool
343422
public function hasError($key, $group = null)
    {
        return !empty($this->validator->getErrors($key, $group));
    }
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;
	}
261562
private function validateKey($key) : bool {
        if (!hash_equals($this->appKey, $key)) {
            throw new \Nuki\Exceptions\Base('Used key does not equal the known application key');
        }
        
        return true;
    }
1102328
protected function validateKey($key)
    {
        if (!is_string($key)) {
            $e = new InvalidArgumentException(sprintf(
                'Cache key must be string, "%s" given', gettype($key)
            ));
            $this->handleException($e, __FUNCTION__);
        }
        if (!isset($key[0])) {
            $e = new InvalidArgumentException('Cache key cannot be an empty string');
            $this->handleException($e, __FUNCTION__);
        }
        if (preg_match('|[\{\}\(\)/\\\@\:]|', $key)) {
            $e = new InvalidArgumentException(sprintf(
                'Invalid key: "%s". The key contains one or more characters reserved for future extension: {}()/\@:',
                $key
            ));
            $this->handleException($e, __FUNCTION__);
        }
    }
468682
private function isWithinGroup(
        ValidatorContextInterface $context,
        ValidationGroupsInterface $mapping
    ): bool {
        if ([] === $groups = $context->getGroups()) {
            return true;
        }

        foreach ($mapping->getGroups() as $group) {
            if (in_array($group, $groups, true)) {
                return true;
            }
        }

        return false;
    }
680534
public function canValidateProperty( $key )
    {
        return isset( $this->data[$key] ) and is_object( $this->data[$key] ) and $this->data[$key] instanceof Base;
    }
944791
protected function _isGroupValid( $oGroup )
    {
        return ( !empty( $oGroup->oxgroups__oxactive->value ) and !empty( $oGroup->oxgroups__oxtitle->value ) );
    }
459658
public function validateKey($key)
    {
        $length = strlen((string) $key);

        if (!$length) {
            $this->addError('key', 'Key cannot be empty');
            return false;
        }

        return true;
    }
1363825
public static function validate($object, $groups = null)
    {
        static::initialize();
        $errors = static::$validator->validate($object, null, $groups);
        if ($errors->count() != 0) {
            //Throw new exception containing the errors
            throw new ValidationFailedException($errors, $object);
        }
    }
223968
public function getByKey($key, $group = null) {
        $query =  $this->model
            ->where('key', $key);

        if(! is_null($group))
            $query->where('group', $group);

        return $query->get();
    }
641473
public function isValid($key = null) {
        if (isset($key)) {
            return empty($this->errors[$key]);
        }
        else {
            return empty($this->errors);
        }
    }
215513
public function validDate($key) : bool
    {
        if ($this->param[$key] instanceof \DateTime) {
            return true;
        }

        $conCate = '';
        $columnName = ucfirst($this->convertToFieldName($key)).' is not';

        if (isset($this->errors[$key.self::ERROR])) {
            $conCate = str_replace('.', '', $this->errors[$key.self::ERROR]).' and ';
            $columnName = 'must be ';
        }

        $date = date_parse($this->param[$key]);
        $isDate = checkdate($date['month'], $date['day'], $date['year']);

        if (!$isDate) {
            $this->errors[$key.self::ERROR] = $conCate.$columnName.' valid date.';
        }

        return true;
    }
952521
public function isAssignedTo($group): bool
    {
        $group = $this->resolveGroup($group);

        return $this->groups()->where('group_id', is_int($group) ? $group : $group->id)->exists();
    }
1319251
protected static function isValidGroupId($group)
    {
        if (empty($group)) {
            echo new \Exception('group('.var_export($group, true).') empty');
            return false;
        }
        return true;
    }
800768
private function feedbackExistsForKey( $key )
	{
		return (isset($this->feedbacks[ $key ]) && ($this->feedbacks[ $key ] instanceof FormFeedback));
	}
617754
public function validateId($key): bool
    {
        if (\preg_match('/^[a-zA-Z0-9-]{127}+$/', $key) !== 1) {
            return false;
        }

        $exist = $this->redis->exists($key);

        return $exist === 1;
    }
162489
public function hasGroup($group)
    {
        if ($this->user() === null) {
            return null;
        }

        return in_array($group, $this->groups, true);
    }