\PhalApi_Request_Formatter_Array

PhalApi_Request_Formatter_Array 格式化数组

  • 提供基本的公共功能,便于子类重用

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(string  $value, array  $rule) : array

对数组格式化/数组转换

Parameters

string $value

变量值

array $rule

array('name' => '', 'type' => 'array', 'default' => '', 'format' => 'json/explode', 'separator' => '', 'min' => '', 'max' => '')

Returns

array

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