Public Member Functions |
| | __construct () |
| | validate_email ($Data, $Name, $Predicates) |
| | validate_float ($Data, $Name, $Predicates) |
| | validate_integer ($Data, $Name, $Predicates) |
| | validate_string ($Data, $Name, $Predicates) |
| | validate_command ($Data, $Name, $Predicates) |
| | validate_set ($Data, $Name, $Predicates) |
| | validate_not_set ($Data, $Name, $Predicates) |
| | validate_not_filled ($Data, $Name, $Predicates) |
| | exec_value ($Data, $Name, $Predicates, $j) |
| | exec_min ($Data, $Name, $Predicates, $j) |
| | exec_max ($Data, $Name, $Predicates, $j) |
| | exec_same_as ($Data, $Name, $Predicates, $j) |
| | exec_simple ($Data, $Name, $Predicates, $j) |
Detailed Description
Predicates.
- Author
- Dodonov A.A.
Definition at line 26 of file predicates.php.
Constructor & Destructor Documentation
Constructor.
- Author
- Dodonov A.A.
Definition at line 64 of file predicates.php.
{
try
{
$this->SecurityParser =
get_package(
'security::security_parser' ,
'last' , __FILE__ );
$this->String =
get_package(
'string' ,
'last' , __FILE__ );
$this->SupportedDataTypes =
get_package(
'security::supported_data_types' ,
'last' , __FILE__ );
}
catch( Exception $e )
{
}
}
Member Function Documentation
| exec_max |
( |
|
$Data, |
|
|
|
$Name, |
|
|
|
$Predicates, |
|
|
|
$j |
|
) |
| |
Function validates array with data.
- Parameters
-
| $Data | - Array with validating data. |
| $Name | - Field name. |
| $Predicates | - Predicates. |
| $j | - Cursor. |
- Returns
- true if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 727 of file predicates.php.
{
try
{
$Value = intval( str_replace( 'max_' , '' , $Predicates[ $j ] ) );
if( $this->SupportedDataTypes->compile_data( $Data[ $Name ] , 'raw' ) > $Value )
{
$this->ErrorMessage = $this->dispatch_error_message( $Predicates );
return( false );
}
return( true );
}
catch( Exception $e )
{
}
}
| exec_min |
( |
|
$Data, |
|
|
|
$Name, |
|
|
|
$Predicates, |
|
|
|
$j |
|
) |
| |
Function validates array with data.
- Parameters
-
| $Data | - Array with validating data. |
| $Name | - Field name. |
| $Predicates | - Predicates. |
| $j | - Cursor. |
- Returns
- true if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 672 of file predicates.php.
{
try
{
$Value = intval( str_replace( 'min_' , '' , $Predicates[ $j ] ) );
if( $this->SupportedDataTypes->compile_data( $Data[ $Name ] , 'raw' ) < $Value )
{
$this->ErrorMessage = $this->dispatch_error_message( $Predicates );
return( false );
}
return( true );
}
catch( Exception $e )
{
}
}
| exec_same_as |
( |
|
$Data, |
|
|
|
$Name, |
|
|
|
$Predicates, |
|
|
|
$j |
|
) |
| |
Function validates array with data.
- Parameters
-
| $Data | - Array with validating data. |
| $Name | - Field name. |
| $Predicates | - Predicates. |
| $j | - Cursor. |
- Returns
- true if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 782 of file predicates.php.
{
try
{
$SecondField = str_replace( 'same_as_' , '' , $Predicates[ $j ] );
$SecondValue = $this->SupportedDataTypes->compile_data( $Data[ $SecondField ] , 'raw' );
$First = $this->SupportedDataTypes->compile_data( $Data[ $Name ] , 'raw' );
$Second = $this->SupportedDataTypes->compile_data( $SecondValue , 'raw' );
if( $First !== $Second )
{
$this->ErrorMessage = $this->dispatch_error_message( $Predicates );
return( false );
}
return( true );
}
catch( Exception $e )
{
}
}
| exec_simple |
( |
|
$Data, |
|
|
|
$Name, |
|
|
|
$Predicates, |
|
|
|
$j |
|
) |
| |
Function validates array with data.
- Parameters
-
| $Data | - Array with validating data. |
| $Name | - Field name. |
| $Predicates | - Predicates. |
| $j | - Cursor. |
- Returns
- true if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 842 of file predicates.php.
{
try
{
if( $Predicates[ $j ] === 'set' )
{
return( $this->exec_set( $Data , $Name , $Predicates ) );
}
if( strpos( $Predicates[ $j ] , 'err_msg_' ) === 0 )
{
return( true );
}
if( strpos( $Predicates[ $j ] , 'default_' ) !== false )
{
return( true );
}
throw( new Exception( "Undefined predicate '".$Predicates[ $j ]."'" ) );
}
catch( Exception $e )
{
}
}
| exec_value |
( |
|
$Data, |
|
|
|
$Name, |
|
|
|
$Predicates, |
|
|
|
$j |
|
) |
| |
Function validates array with data.
- Parameters
-
| $Data | - Array with validating data. |
| $Name | - Field name. |
| $Predicates | - Predicates. |
| $j | - Cursor. |
- Returns
- true if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 617 of file predicates.php.
{
try
{
$Value = str_replace( 'value_' , '' , $Predicates[ $j ] );
if( $this->SupportedDataTypes->compile_data( @$Data[ $Name ] , 'raw' ) != $Value )
{
$this->ErrorMessage = $this->dispatch_error_message( $Predicates );
return( false );
}
return( true );
}
catch( Exception $e )
{
}
}
| validate_command |
( |
|
$Data, |
|
|
|
$Name, |
|
|
|
$Predicates |
|
) |
| |
Function validates array with data.
- Parameters
-
| $Data | - Array with validating data. |
| $Name | - Field name. |
| $Predicates | - Predicates. |
- Returns
- true if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 364 of file predicates.php.
{
try
{
if( $Value == '' && $this->SecurityParser->allow_not_set( $Predicates ) )
{
return( true );
}
if( $this->SupportedDataTypes->compile_data( $Value , 'command' ) != $Value )
{
$this->ErrorMessage = $this->dispatch_error_message( $Predicates );
return( false );
}
return( true );
}
catch( Exception $e )
{
}
}
| validate_email |
( |
|
$Data, |
|
|
|
$Name, |
|
|
|
$Predicates |
|
) |
| |
Function validates array with data.
- Parameters
-
| $Data | - Array with validating data. |
| $Name | - Field name. |
| $Predicates | - Predicates. |
- Returns
- true if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 149 of file predicates.php.
{
try
{
if( $Value == '' && $this->SecurityParser->allow_not_set( $Predicates ) )
{
return( true );
}
if( $Value == '' || $this->SupportedDataTypes->compile_data( $Value , 'email' ) != $Value )
{
$this->ErrorMessage = $this->dispatch_error_message( $Predicates );
return( false );
}
return( true );
}
catch( Exception $e )
{
}
}
| validate_float |
( |
|
$Data, |
|
|
|
$Name, |
|
|
|
$Predicates |
|
) |
| |
Function validates array with data.
- Parameters
-
| $Data | - Array with validating data. |
| $Name | - Field name. |
| $Predicates | - Predicates. |
- Returns
- true if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 204 of file predicates.php.
{
try
{
if( $Value === '' && $this->SecurityParser->allow_not_set( $Predicates ) )
{
return( true );
}
if( $Value === '' || $this->SupportedDataTypes->compile_data( $Value , 'float' ) != $Value )
{
$this->ErrorMessage = $this->dispatch_error_message( $Predicates );
return( false );
}
return( true );
}
catch( Exception $e )
{
}
}
| validate_integer |
( |
|
$Data, |
|
|
|
$Name, |
|
|
|
$Predicates |
|
) |
| |
Function validates array with data.
- Parameters
-
| $Data | - Array with validating data. |
| $Name | - Field name. |
| $Predicates | - Predicates. |
- Returns
- true if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 259 of file predicates.php.
{
try
{
if( $Value === '' && $this->SecurityParser->allow_not_set( $Predicates ) )
{
return( true );
}
if( $Value === '' || $this->SupportedDataTypes->compile_data( $Value , 'integer' ) != $Value )
{
$this->ErrorMessage = $this->dispatch_error_message( $Predicates );
return( false );
}
return( true );
}
catch( Exception $e )
{
}
}
| validate_not_filled |
( |
|
$Data, |
|
|
|
$Name, |
|
|
|
$Predicates |
|
) |
| |
Function validates array with data.
- Parameters
-
| $Data | - Array with validating data. |
| $Name | - Field name. |
| $Predicates | - Predicates. |
- Returns
- true if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 515 of file predicates.php.
{
try
{
if( $Value != '' )
{
$this->ErrorMessage = $this->dispatch_error_message( $Predicates );
return( false );
}
return( true );
}
catch( Exception $e )
{
}
}
| validate_not_set |
( |
|
$Data, |
|
|
|
$Name, |
|
|
|
$Predicates |
|
) |
| |
Function validates array with data.
- Parameters
-
| $Data | - Array with validating data. |
| $Name | - Field name. |
| $Predicates | - Predicates. |
- Returns
- true if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 467 of file predicates.php.
{
try
{
if( isset( $Data[ $Name ] ) === true )
{
$this->ErrorMessage = $this->dispatch_error_message( $Predicates );
return( false );
}
return( true );
}
catch( Exception $e )
{
}
}
| validate_set |
( |
|
$Data, |
|
|
|
$Name, |
|
|
|
$Predicates |
|
) |
| |
Function validates array with data.
- Parameters
-
| $Data | - Array with validating data. |
| $Name | - Field name. |
| $Predicates | - Predicates. |
- Returns
- true if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 419 of file predicates.php.
{
try
{
if( isset( $Data[ $Name ] ) === false )
{
$this->ErrorMessage = $this->dispatch_error_message( $Predicates );
return( false );
}
return( true );
}
catch( Exception $e )
{
}
}
| validate_string |
( |
|
$Data, |
|
|
|
$Name, |
|
|
|
$Predicates |
|
) |
| |
Function validates array with data.
- Parameters
-
| $Data | - Array with validating data. |
| $Name | - Field name. |
| $Predicates | - Predicates. |
- Returns
- true if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 314 of file predicates.php.
{
try
{
if( $Value == '' && $this->SecurityParser->allow_not_set( $Predicates ) === false )
{
$this->ErrorMessage = $this->dispatch_error_message( $Predicates );
return( false );
}
return( true );
}
catch( Exception $e )
{
}
}
Field Documentation
Validation error.
- Author
- Dodonov A.A.
Definition at line 52 of file predicates.php.
Cached objects.
- Author
- Dodonov A.A.
Definition at line 38 of file predicates.php.
| $SupportedDataTypes = false |
The documentation for this class was generated from the following file:
- packages/security/packages/security_validator/packages/predicates/predicates.php