PHP 클래스 Lazer\Classes\Helpers\Validate

저자: Grzegorz Kuźnik
파일 보기 프로젝트 열기: greg0/lazer-database 1 사용 예제들

공개 메소드들

메소드 설명
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