\PhalApi_Request_Formatter_Callback

PhalApi_Request_Formatter_Callback 回调类型

  • 等效于PhalApi_Request_Formatter_Callable

Summary

Methods
Properties
Constants
parse()
No public properties found
No constants found
filterByRange()
filterRangeMinLessThanOrEqualsMax()
filterRangeCheckMin()
filterRangeCheckMax()
formatEnumValue()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

parse()

parse(mixed  $value, array  $rule) : \boolean/string

对回调类型进行格式化

Parameters

mixed $value

变量值

array $rule

array('callback' => '回调函数', 'params' => '第三个参数')

Returns

\boolean/string —

格式化后的变量

filterByRange()

filterByRange(  $value,   $rule) 

根据范围进行控制

Parameters

$value
$rule

filterRangeMinLessThanOrEqualsMax()

filterRangeMinLessThanOrEqualsMax(  $rule) 

Parameters

$rule

filterRangeCheckMin()

filterRangeCheckMin(  $value,   $rule) 

Parameters

$value
$rule

filterRangeCheckMax()

filterRangeCheckMax(  $value,   $rule) 

Parameters

$value
$rule

formatEnumValue()

formatEnumValue(string  $value, array  $rule) 

格式化枚举类型

Parameters

string $value

变量值

array $rule

array('name' => '', 'type' => 'enum', 'default' => '', 'range' => array(...))

Throws

\PhalApi_Exception_BadRequest