Flikore Validator
  • Api
  • Namespace
  • Class
  • Tree
  • Deprecated

Namespaces

  • Flikore
    • Validator
      • Exception
      • Interfaces
      • Intl
      • Validators

Classes

  • ValidationChoice
  • ValidationCombo
  • ValidationKey
  • ValidationSet
  • ValidationValue
  • Validator

Class Validator

The base for validation classes.

Flikore\Validator\Validator implements Flikore\Validator\Interfaces\IValidator

Direct known subclasses

Flikore\Validator\ValidationChoice, Flikore\Validator\ValidationCombo, Flikore\Validator\Validators\InstanceOfValidator, Flikore\Validator\Validators\IPv4Validator, Flikore\Validator\Validators\IPv6Validator, Flikore\Validator\Validators\LengthBetweenValidator, Flikore\Validator\Validators\LessThanValidator, Flikore\Validator\Validators\LetterNumericValidator, Flikore\Validator\Validators\LetterValidator, Flikore\Validator\Validators\MaxLengthValidator, Flikore\Validator\Validators\MaxValueValidator, Flikore\Validator\Validators\MinAgeValidator, Flikore\Validator\Validators\AfterDateTimeValidator, Flikore\Validator\Validators\MinLengthValidator, Flikore\Validator\Validators\MinValueValidator, Flikore\Validator\Validators\NotEmptyValidator, Flikore\Validator\Validators\NumericValidator, Flikore\Validator\Validators\RecursiveValidator, Flikore\Validator\Validators\RegexValidator, Flikore\Validator\Validators\UriValidator, Flikore\Validator\Validators\ValueBetweenValidator, Flikore\Validator\Validators\BeforeDateTimeValidator, Flikore\Validator\Validators\DateTimeValidator, Flikore\Validator\Validators\EmailValidator, Flikore\Validator\Validators\EqualsValidator, Flikore\Validator\Validators\ExactLengthValidator, Flikore\Validator\Validators\ExactValueValidator, Flikore\Validator\Validators\GreaterThanValidator

Indirect known subclasses

Flikore\Validator\Validators\AlphaNumericValidator, Flikore\Validator\Validators\AlphaValidator, Flikore\Validator\Validators\DateValidator, Flikore\Validator\Validators\MaxDateTimeValidator, Flikore\Validator\Validators\MinDateTimeValidator, Flikore\Validator\Validators\NoSpaceValidator, Flikore\Validator\Validators\NotEqualsValidator, Flikore\Validator\Validators\OrValidator

Abstract
Namespace: Flikore\Validator
Package: Flikore\Validator
Copyright: (c) 2014, George Marques
License: MIT
Author: George Marques <george at georgemarques.com.br>
Version: 0.5.2
Since: 0.1
Located at Flikore/Validator/Validator.php

Methods summary

public boolean
# validate( mixed $value )

Checks if the value passes the validation test.

Checks if the value passes the validation test.

Parameters

$value
mixed
$value The value to test.

Returns

boolean
Whether it passes the test or not.

Implementation of

Flikore\Validator\Interfaces\IValidator::validate()
public
# assert( mixed $value )

Checks if the value passes the validation test and throws an exception if not.

Checks if the value passes the validation test and throws an exception if not.

Parameters

$value
mixed
$value The value to test.

Throws

Flikore\Validator\Exception\ValidatorException

Implementation of

Flikore\Validator\Interfaces\IValidator::assert()
public string
# getErrorMessage( )

Gets the error message for this validation. This should work whether or not there was a test before.

Gets the error message for this validation. This should work whether or not there was a test before.

Returns

string
The error message.
public
# setErrorMessage( string $message )

Sets the error message for this validator.

Sets the error message for this validator.

Parameters

$message
string
$message The message.
public
# addKeyValue( string $key, string $value )

Adds a new key-value pair to be replaced by the templating engine. This does not check if it's replacing a specific validator value.

Adds a new key-value pair to be replaced by the templating engine. This does not check if it's replacing a specific validator value.

Parameters

$key
string
$key The key to replace (in the template as "%key%")
$value
string
$value The value to be inserted instead of the key.

Implementation of

Flikore\Validator\Interfaces\IValidator::addKeyValue()
protected string
# applyTemplate( )

Applies the template message to a formed one.

Applies the template message to a formed one.

Returns

string
The formed message.
abstract protected boolean
# doValidate( mixed $value )

Executes the real validation so it can be reused.

Executes the real validation so it can be reused.

Parameters

$value
mixed
$value The value to validate.

Returns

boolean
Whether the value pass the validation.
protected boolean
# isEmpty( mixed $value )

Checks if a value is considered empty, so the derived validators can have a standard.

Checks if a value is considered empty, so the derived validators can have a standard.

Parameters

$value
mixed
$value The value to check.

Returns

boolean
Whether it is empty or not.

Magic methods summary

Properties summary

protected string $message
#

The error message for this validator.

The error message for this validator.

protected array $values
#

Stores the values to change in the template.

Stores the values to change in the template.

Flikore Validator API documentation generated by ApiGen 2.8.0