PHP 클래스 Cake\Localized\Validation\CnValidation

상속: extends LocalizedValidation
파일 보기 프로젝트 열기: cakephp/localized 1 사용 예제들

공개 메소드들

메소드 설명
personId ( string $check ) : boolean Checks national identify number for The Peoples Republic of China (mainland).
phone ( string $check ) : boolean Checks phone numbers for The Peoples Republic of China (mainland)
postal ( string $check ) : boolean Checks a postal code for The Peoples Republic of China (mainland)

메소드 상세

personId() 공개 정적인 메소드

Compliant with GB11643-1999 national standard.
public static personId ( string $check ) : boolean
$check string The value to check.
리턴 boolean Success.

phone() 공개 정적인 메소드

It is not a strict rule and should cover almost all legal phone numbers. Some (obviously) illegal phone numbers will pass this test, especially cellphone. Since it will be a hard task to maintain a small cellphone prefix "database", just make it simple for now.
public static phone ( string $check ) : boolean
$check string The value to check.
리턴 boolean Success.

postal() 공개 정적인 메소드

In fact the national standard allows to omit the final two digits if they are both 0, but few people write postal number in this way nowadays.
public static postal ( string $check ) : boolean
$check string The value to check.
리턴 boolean Success.