PHP 클래스 ValidationModel, thinksns

저자: daniel ([email protected])
상속: extends Model
파일 보기 프로젝트 열기: medz/thinksns-4

보호된 프로퍼티들

프로퍼티 타입 설명
$fields
$tableName

공개 메소드들

메소드 설명
addValidation ( integer $from_uid, string $to_user, string $target_url, string $type = '', string $data = '' ) : boolean 添加验证
dispatchValidation ( integer $id, string $validation_code ) 分发验证
getValidation ( integer $id, string $code ) : mix 获取邀请详细
isEmailAvailable ( string $email, integer $uid = false ) : boolean 验证Email是否可用
isValidEmail ( string $email ) : boolean 检查Email地址是否合法
isValidValidationCode ( integer $id, string $code ) : boolean 判断给定的验证ID和验证码是否合法
unsetValidation ( integer $id ) : boolean 取消邀请,即设置验证为失效

비공개 메소드들

메소드 설명
__generateCode ( integer $id ) : string 生成唯一的验证码

메소드 상세

addValidation() 공개 메소드

添加验证
public addValidation ( integer $from_uid, string $to_user, string $target_url, string $type = '', string $data = '' ) : boolean
$from_uid integer 验证的来源
$to_user string 验证的目的地
$target_url string 进行验证的url地址
$type string 验证类型
$data string 附加数据
리턴 boolean 是否添加认证成功

dispatchValidation() 공개 메소드

分发验证
public dispatchValidation ( integer $id, string $validation_code )
$id integer 验证的ID(为0或留空时,自动从$_REQUEST获取)
$validation_code string 验证码(为0或留空时,自动从$_REQUEST获取)

getValidation() 공개 메소드

获取邀请详细
public getValidation ( integer $id, string $code ) : mix
$id integer 验证的ID(为0或留空时,自动从$_REQUEST获取)
$code string 验证码(为0或留空时,自动从$_REQUEST获取)
리턴 mix 获取失败返回false,成功后返回邀请详细

isEmailAvailable() 공개 메소드

验证Email是否可用
public isEmailAvailable ( string $email, integer $uid = false ) : boolean
$email string 邮件地址
$uid integer 邀请人的用户ID
리턴 boolean 邮件地址是否可用

isValidEmail() 공개 메소드

检查Email地址是否合法
public isValidEmail ( string $email ) : boolean
$email string 邮件地址
리턴 boolean 邮件地址是否合法

isValidValidationCode() 공개 메소드

判断给定的验证ID和验证码是否合法
public isValidValidationCode ( integer $id, string $code ) : boolean
$id integer 验证的ID(为0或留空时,自动从$_REQUEST获取)
$code string 验证码(为0或留空时,自动从$_REQUEST获取)
리턴 boolean 验证ID与验证码是否合法

unsetValidation() 공개 메소드

取消邀请,即设置验证为失效
public unsetValidation ( integer $id ) : boolean
$id integer 验证的ID(为0或留空时,自动从$_REQUEST获取)
리턴 boolean 是否取消成功

프로퍼티 상세

$fields 보호되어 있는 프로퍼티

protected $fields

$tableName 보호되어 있는 프로퍼티

protected $tableName