PHP Класс Lazer\Classes\Helpers\Validate

Автор: Grzegorz Kuźnik
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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]

Описание методов

arrToLower() публичный статический Метод

Change keys and values case to lower
public static arrToLower ( array $array ) : array
$array array
Результат array

exists() публичный Метод

Checking that Table and Config exists and throw exceptions if not
public exists ( ) : boolean
Результат boolean

field() публичный Метод

Checking that typed field really exist in table
public field ( string $name ) : boolean
$name string
Результат boolean

fields() публичный Метод

Checking that typed fields really exist in table
public fields ( array $fields ) : boolean
$fields array Indexed array
Результат boolean

filter() публичный статический Метод

Delete ID field from arrays
public static filter ( array $fields ) : array
$fields array
Результат array Fields without ID

isNumeric() публичный статический Метод

Checking that field type is numeric
public static isNumeric ( string $type ) : boolean
$type string
Результат boolean

relation() публичный статический Метод

Checking that relation between tables exists
public static relation ( string $local, string $foreign ) : boolean
$local string local table
$foreign string related table
Результат boolean relation exists

relationType() публичный статический Метод

Checking that relation type is correct
public static relationType ( string $type ) : boolean
$type string
Результат boolean relation type

table() публичный статический Метод

Table name
public static table ( string $name ) : Validate
$name string
Результат Validate

type() публичный Метод

Checking that typed field have correct type of value
public type ( string $name, mixed $value ) : boolean
$name string
$value mixed
Результат boolean

types() публичный статический Метод

Checking that types from array matching with [boolean, integer, string, double]
public static types ( array $types ) : boolean
$types array Indexed array
Результат boolean