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

Namespaces

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

Classes

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

Class ValidationChoice

Validates that the value pass in at least one of the given validators.

Flikore\Validator\Validator implements Flikore\Validator\Interfaces\IValidator
Extended by Flikore\Validator\ValidationChoice

Direct known subclasses

Flikore\Validator\Validators\OrValidator

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.5.0
CustomKey: %vN% The message of the Nth validator (1-index).
Located at Flikore/Validator/ValidationChoice.php

Methods summary

public
# __construct( )

Creates a new Validation Choice. You can pass as many validators as you want.

Creates a new Validation Choice. You can pass as many validators as you want.

public
# addValidator( Flikore\Validator\Validator $validator )

Adds a new validator to the combo.

Adds a new validator to the combo.

Parameters

$validator
Flikore\Validator\Validator
$validator The validator to add.
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.

Overrides

Flikore\Validator\Validator::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.

Overrides

Flikore\Validator\Validator::applyTemplate
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.

Methods inherited from Flikore\Validator\Validator

assert(), getErrorMessage(), isEmpty(), setErrorMessage(), validate()

Magic methods summary

Properties summary

protected Flikore\Validator\Validator[] $validators
#

An array of validators to test.

An array of validators to test.

protected string $message
#

The error message for this validator.

The error message for this validator.

Properties inherited from Flikore\Validator\Validator

$values

Flikore Validator API documentation generated by ApiGen 2.8.0