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

Namespaces

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

Classes

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

Class ValidationValue

This class can be used as a validation rule in a set to use the fields from the object being validate as an input to the constructor of a validator. This delegates the proper construction of the validation until there are an object to validate.

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.4.0
Located at Flikore/Validator/ValidationValue.php

Methods summary

public
# __construct( string|Flikore\Validator\Interfaces\IValidator $validator )

Creates a new validation value for a validation set.

Creates a new validation value for a validation set.

Parameters

$validator
string|Flikore\Validator\Interfaces\IValidator
$validator The validator to build be it a class name (fully qualified) or a dummy validator object.
public
# addKeyValue( string $key, mixed $value )

Adds a new key-value pair to be replaced by the templating engine of the generated validator. 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 of the generated validator. 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
mixed
$value The value to be inserted instead of the key.
public
# setErrorMessage( string $message )

Sets the error message for the generated validator.

Sets the error message for the generated validator.

Parameters

$message
string
$message The message.
public Flikore\Validator\Validator
# createRule( array $fields )

Creates a new concrete validator rule based on the given array. Such array is created automatically by ValidationSet.

Creates a new concrete validator rule based on the given array. Such array is created automatically by ValidationSet.

Parameters

$fields
array
$fields The key-value fileds

Returns

Flikore\Validator\Validator
The built validator.
public array
# getFields( )

Gets the fields needed to construct the delegated validator.

Gets the fields needed to construct the delegated validator.

Returns

array
The list of fields.

Magic methods summary

Properties summary

protected string $validator
#

The validator to build.

The validator to build.

protected array $args
#

The arguments to the validator constructor.

The arguments to the validator constructor.

protected array $fields
#

A list of fields to fecth from the validated object.

A list of fields to fecth from the validated object.

protected string $message
#

The error message to the generated validator.

The error message to the generated validator.

protected array $values
#

The key-value pairs to insert in the generated validator.

The key-value pairs to insert in the generated validator.

Flikore Validator API documentation generated by ApiGen 2.8.0