| Total Complexity | 5 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class TableStructMiddleware extends ObjectMiddleware |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * 数据结构 |
||
| 16 | * |
||
| 17 | * @var TableStruct |
||
| 18 | */ |
||
| 19 | protected $struct; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * 创建中间件 |
||
| 23 | * |
||
| 24 | * @param string $object |
||
| 25 | */ |
||
| 26 | public function __construct(string $object, TableStruct $struct) |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * 处理输入字段名 |
||
| 35 | */ |
||
| 36 | public function inputName(string $name):string |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * 处理输出字段名 |
||
| 43 | * |
||
| 44 | * @param string $name |
||
| 45 | * @param mixed $data |
||
| 46 | * @return mixed |
||
| 47 | */ |
||
| 48 | public function outputName(string $name):string |
||
| 49 | { |
||
| 50 | return $this->struct->getFields()->outputName($name); |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * 创建处理集合 |
||
| 55 | * |
||
| 56 | * @param string $object |
||
| 57 | * @return void |
||
| 58 | */ |
||
| 59 | protected function prepareProcessorSet(string $object) |
||
| 66 | } |
||
| 67 | } |
||
| 69 |