PHP Class Lazer\Classes\Helpers\Validate

Author: Grzegorz Kuźnik
Afficher le fichier Open project: greg0/lazer-database Class Usage Examples

Méthodes publiques

Méthode Description
arrToLower ( array $array ) : array Change keys and values case to lower
exists ( ) : boolean Checking that Table and Config exists and throw exceptions if not
field ( string $name ) : boolean Checking that typed field really exist in table
fields ( array $fields ) : boolean Checking that typed fields really exist in table
filter ( array $fields ) : array Delete ID field from arrays
isNumeric ( string $type ) : boolean Checking that field type is numeric
relation ( string $local, string $foreign ) : boolean Checking that relation between tables exists
relationType ( string $type ) : boolean Checking that relation type is correct
table ( string $name ) : Validate Table name
type ( string $name, mixed $value ) : boolean Checking that typed field have correct type of value
types ( array $types ) : boolean Checking that types from array matching with [boolean, integer, string, double]

Method Details

arrToLower() public static méthode

Change keys and values case to lower
public static arrToLower ( array $array ) : array
$array array
Résultat array

exists() public méthode

Checking that Table and Config exists and throw exceptions if not
public exists ( ) : boolean
Résultat boolean

field() public méthode

Checking that typed field really exist in table
public field ( string $name ) : boolean
$name string
Résultat boolean

fields() public méthode

Checking that typed fields really exist in table
public fields ( array $fields ) : boolean
$fields array Indexed array
Résultat boolean

filter() public static méthode

Delete ID field from arrays
public static filter ( array $fields ) : array
$fields array
Résultat array Fields without ID

isNumeric() public static méthode

Checking that field type is numeric
public static isNumeric ( string $type ) : boolean
$type string
Résultat boolean

relation() public static méthode

Checking that relation between tables exists
public static relation ( string $local, string $foreign ) : boolean
$local string local table
$foreign string related table
Résultat boolean relation exists

relationType() public static méthode

Checking that relation type is correct
public static relationType ( string $type ) : boolean
$type string
Résultat boolean relation type

table() public static méthode

Table name
public static table ( string $name ) : Validate
$name string
Résultat Validate

type() public méthode

Checking that typed field have correct type of value
public type ( string $name, mixed $value ) : boolean
$name string
$value mixed
Résultat boolean

types() public static méthode

Checking that types from array matching with [boolean, integer, string, double]
public static types ( array $types ) : boolean
$types array Indexed array
Résultat boolean