Lumen 快速开发工具包  v1.2.2
BaseTransformer类 参考

Transformer 通用类 更多...

类 BaseTransformer 继承关系图:
BaseTransformer 的协作图:

Public 成员函数

 __construct (ParamBag $params=null)
 
 transform ($models)
 过滤处理
 
 hide (array $fields)
 隐藏字段处理
 
 show (array $fields)
 只显示字段处理
 

Protected 成员函数

 withParamBagShow (ParamBag $params=null)
 include 中字段显示过滤处理 @detail URI:xxxx?include=xx:show(field|field|field):hide(field|field|field) 更多...
 
 withFilterFields (array $array)
 include 中字段显示过滤数组处理 更多...
 
 withParamLimit (ParamBag $params=null)
 include 中 limit 处理 @detail URI:xxxx?include=xx:limit(10)
 
 withParamOrderFilter ($relations, ParamBag $params=null)
 include 中 where 和 order 处理 @detail URI:xxxx?include=xx:order(id|desc):where(id|>|2)
 

Protected 属性

 $withHideFields = []
 默认隐藏字段
 
 $withShowFields = []
 默认只显示字段
 
 $withParamLimit = 10
 默认 include 条数
 
 $withParamOrder = ['id', 'desc']
 默认 include 排序
 

详细描述

Transformer 通用类

成员函数说明

◆ withFilterFields()

withFilterFields ( array  $array)
protected

include 中字段显示过滤数组处理

参数
$array字段名称数组

被这些函数引用 BaseTransformer\transform().

这是这个函数的调用关系图:

◆ withParamBagShow()

withParamBagShow ( ParamBag  $params = null)
protected

include 中字段显示过滤处理 @detail URI:xxxx?include=xx:show(field|field|field):hide(field|field|field)

参数
$paramsinclude 中的参数

引用了 BaseTransformer\hide() , 以及 BaseTransformer\show().

函数调用图:

该类的文档由以下文件生成: