protected function validateExists($value, string $parameter, array $args = [], array $rules = null, array $context = null): ?string
    {
        if (count($args) < 2) {
            throw new ValidatorConfigException("Validator 'exists' must have at least two defined arguments; parameter={$parameter}");
        }

        array_walk($args, 'trim');

        if ($args[0] == '') {
            throw new ValidatorConfigException("Validator 'exists' must have non-empty string for argument=0; parameter={$parameter}");
        }

        //$value = $this->getValue($parameter);

        if ($value === null) {
            return null;
        }

        if (!is_scalar($value)) {
            return Message::getMessage(Message::PRIMITIVE, [
                'param' => $parameter
            ]);
        }

        $value = trim((string)$value);

        if ($value === '') {
            return null;
        }

        /** @var Model $modelClass */
        list($modelClass, $queryField) = $args;

        if ($modelClass::count([$queryField => $value]) == 0) {
            return Message::getMessage(Message::NO_RECORD, [
                'param' => $parameter,
                'value' => $value,
                'field' => $queryField
            ]);
        }

        return null;
    }