Validates that the inserted value is not null or empty. This
will throw an AdldapException otherwise.

@param string $parameter
@param string $value

@return bool

@throws AdldapException
558351
public function validateNotNullOrEmpty($parameter, $value)
    {
        $this->validateNotNull($parameter, $value);

        $this->validateNotEmpty($parameter, $value);

        return true;
    }
183594
public function isValid($value) {
		if ($this->validator === null) {
			throw new ValidationFailure('Zend validator wasn\'t been suplied');
		}
		
		return $this->validator->isValid($value);
	}
1276189
public function validateValueType($value)
    {
        if ($this->hasOption(Entity\Reflection\Property\Option\Primary::KEY)
            && (Entity\Reflection\Property\Option\Primary::isEmpty($value))
        ) {
            throw new Exception\InvalidArgumentException(
                "Primary value can not be empty string or null!",
                $value
            );
        }

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

        // Enumeration
        if ($this->hasOption(Entity\Reflection\Property\Option\Enum::KEY)
            && !$this->getOption(Entity\Reflection\Property\Option\Enum::KEY)->isValid($value)
        ) {
            throw new Exception\InvalidArgumentException(
                "Value " . $value . " is not from defined entity enumeration "
                . "range on property " . $this->name . "!",
                $value
            );
        }

        // Scalar or array type
        if (self::isScalarType($this->type) || $this->type === self::TYPE_ARRAY) {

            if (gettype($value) === $this->type) {
                return;
            }
            throw new Exception\InvalidArgumentException(
                "Expected " . $this->type . " but " . gettype($value)
                . " given on property " . $this->name . "!",
                $value
            );
        }

        // Object validation
        $givenType = gettype($value);
        if ($givenType === "object") {
            $givenType = get_class($value);
        }

        if ($this->type === self::TYPE_ENTITY) {
            // Entity

            $expectedEntityClass = Convention::nameToClass($this->typeOption, Convention::ENTITY_MASK);
            if ($value instanceof $expectedEntityClass) {
                return;
            } else {
                throw new Exception\InvalidArgumentException(
                    "Expected entity " . $this->typeOption . " but " . $givenType
                    . " given on property " . $this->name . "!",
                    $value
                );
            }
        } elseif ($this->type === self::TYPE_COLLECTION) {
            // Collection

            $entityClass = Convention::nameToClass($this->typeOption, Convention::ENTITY_MASK);
            if (!$value instanceof Entity\Collection) {

                throw new Exception\InvalidArgumentException(
                    "Expected entity collection but " . $givenType . " given on"
                    . " property " . $this->name . "!",
                    $value
                );
            } elseif ($value->getEntityClass() !== $entityClass) {
                throw new Exception\InvalidArgumentException(
                    "Expected collection of entity " . $entityClass
                    . " but collection of entity " . $value->getEntityClass()
                    . " given on property " . $this->name . "!",
                    $value
                );
            } else {
                return;
            }
        } elseif ($this->type === self::TYPE_DATETIME) {
            // DateTime

            if ($value instanceof \DateTime) {
                return;
            } else {
                throw new Exception\InvalidArgumentException(
                    "Expected DateTime but " . $givenType . " given on"
                    . " property " . $this->name . "!",
                    $value
                );
            }
        } elseif ($this->type === self::TYPE_DATE) {
            // Date

            if ($value instanceof \DateTime) {
                return;
            } else {
                throw new Exception\InvalidArgumentException(
                    "Expected date as DateTime object but " . $givenType
                    . " given on property " . $this->name . "!",
                    $value
                );
            }
        } else {
            // Unexpected

            throw new \Exception("Unsupported type " . $this->type . "!");
        }
    }
821306
public function bindValue($parameter, $value, int $dataType = \PDO::PARAM_STR): bool
    {
        return $this->statement->bindValue($parameter, $value, $dataType);
    }
935000
private function setPayloadParameter(string $parameter, $value): void
    {
        $this->checkParameterType($value);

        $this->defaultSetPayloadParameter($parameter, $value);
    }
370220
public function validate($value)
    {
        $result = !$this->isRequired;
        if ($this->isRequired()) {
            $result = !empty($value);
        }
        if (is_callable($this->validator)) {
            $result = call_user_func($this->validator, $value);
        }

        return $result;
    }
496762
public function isLength($value, $parameter)
    {
        $min = $parameter[0];
        $max = $parameter[1];
        if ($min != 0 && strlen($value) < $min) {
            return false;
        }
        if ($max != 0 && strlen($value) > $max) {
            return false;
        }

        return true;
    }
321123
protected function validateIn( $attribute, $value, $parameters )
	{
		if ( is_array( $value ) && $this->hasRule( $attribute, 'Array' ) )
		{
			return count( array_diff( $value, $parameters ) ) == 0;
		}

		return !is_array( $value ) && in_array( (string) $value, $parameters );
	}
1122823
protected function _validate_date($value, $parameter = null)
    {
        $context = $this->_context;

        $ts = is_numeric($value) ? (int)$value : strtotime($value);
        if ($ts === false) {
            return null;
        }

        $r = date($context->model->getDateFormat($context->field), $ts);
        return $r !== false ? $r : null;
    }
1036365
protected function _validate_range($value, $parameter)
    {
        if (preg_match('#^(-?[\.\d]+)-(-?[\d\.]+)$#', $parameter, $match)) {
            return $value >= $match[1] && $value <= $match[2] ? $value : null;
        } else {
            throw new InvalidValueException(['range validator `:parameter` parameters is not {min}-{max} format', 'parameter' => $parameter]);
        }
    }
9843
protected function validateDateFormat($attribute, $value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'date_format');

        $parsed = date_parse_from_format($parameters[0], $value);

        return $parsed['error_count'] === 0 && $parsed['warning_count'] === 0;
    }
757674
protected function validate($value)
	{
		if ($value < $this->minValue || $value > $this->maxValue)
		{
			throw new InvalidArgumentException('Value ' . $value . ' is out of bounds (' . $this->minValue . '..' . $this->maxValue . ')');
		}
	}
866607
protected function validateAfterWithFormat($format, $value, $parameters)
    {
        $param = $this->getValue($parameters[0]) ?: $parameters[0];

        return $this->checkDateTimeOrder($format, $param, $value);
    }
1297774
public static function isValid($value)
    {
        if ($value instanceof \DateTime)
            return true;
        try {
            new static($value);
            return !is_null($value);
        } catch (\Exception $e) {
            return false;
        }
    }
1269589
protected function isRequiredIf($value, $parameters)
    {
        $this->requireParameterCount(2, $parameters, 'required_if');

        $other = Arr::get($this->data, $parameters[0]);

        $values = array_slice($parameters, 1);

        if (is_bool($other)) {
            $values = $this->convertValuesToBoolean($values);
        }

        if (in_array($other, $values)) {
            return $this->isRequired($value);
        }

        return true;
    }
495688
public function bindValue($parameter, $value, int $dataType = \PDO::PARAM_STR): bool
    {
        $this->binds[$parameter] = $value;
        return true;
    }
1106301
public function bindValue($parameter, $value, $data_type = PDO::PARAM_STR)
    {
        $this->bindings->push(
            $this->wye->makeBinding($parameter, $value, $data_type)
        );

        return true;
    }