PHP Class XdataModel, thinksns

Author: liuxiaoqing ([email protected])
Inheritance: extends Model
Show file Open project: medz/thinksns-4 Class Usage Examples

Protected Properties

Property Type Description
$fields
$list_name
$tableName
$whiteList 键值白名单,主要用于获取和设置配置文件某个

Public Methods

Method Description
get ( string $key ) : string 读取数据list:key
getAll ( string $listName, array | object $keys ) : array 批量读取数据,非必要
getConfig ( string $key, string $systemKey, string $systemList = 'admin_Config' ) : string 传入的key参数为直接要获取的的key值
lget ( string $list_name = '', boolean $nostatic = false ) : array 读取参数列表
lput ( string $listName = '', array $listData = [] ) : boolean 写入参数列表
put ( string $key, string $value = '', boolean $replace = true ) : boolean 写入单个数据
saveKey ( string $key, string $value = '' ) : boolean 存储单个数据,将原来的save修改为saveKey

Protected Methods

Method Description
_parse_keys ( string | object | array $input = '' ) : array 解析过滤输入
_strip_key ( string $key = '' ) : string 过滤key值

Method Details

_parse_keys() protected method

解析过滤输入
protected _parse_keys ( string | object | array $input = '' ) : array
$input string | object | array 输入的数据
return array 解析过滤后的输入数据

_strip_key() protected method

过滤key值
protected _strip_key ( string $key = '' ) : string
$key string 只允许格式,数字字母下划线,list:key不允许出现html代码和这些符号 ' " & * % ^ $ ? ->
return string 过滤后的key值

get() public method

读取数据list:key
public get ( string $key ) : string
$key string 要获取的某个参数list:key;如果没有:则认为,只有list没有key
return string 相应的list中的key值数据

getAll() public method

批量读取数据,非必要
public getAll ( string $listName, array | object $keys ) : array
$listName string 参数列表list
$keys array | object 参数键key
return array 通过list与key批量获取的数据

getConfig() public method

传入的key参数为直接要获取的的key值
public getConfig ( string $key, string $systemKey, string $systemList = 'admin_Config' ) : string
$key string 在配置中的key值 [必须]
$systemKey string 在system_data表中的key值 [必须]
$systemList string 在system_data表中的list值 默认为Config
return string 获取key对应的值

lget() public method

读取参数列表
public lget ( string $list_name = '', boolean $nostatic = false ) : array
$list_name string 参数列表list
$nostatic boolean 是否不使用静态缓存,默认为false
return array 参数列表

lput() public method

写入参数列表
public lput ( string $listName = '', array $listData = [] ) : boolean
$listName string 参数列表list
$listData array 存入的数据,形式为key=>value
return boolean 是否写入成功

put() public method

写入单个数据
public put ( string $key, string $value = '', boolean $replace = true ) : boolean
$key string 要存储的参数list:key
$value string 要存储的参数的值
$replace boolean false为插入新参数,ture为更新已有参数,默认为true
return boolean 是否写入成功

saveKey() public method

存储单个数据,将原来的save修改为saveKey
public saveKey ( string $key, string $value = '' ) : boolean
$key string 要存储的参数list:key
$value string 要存储的参数的值
return boolean 是否存储成功

Property Details

$fields protected property

protected $fields

$list_name protected property

protected $list_name

$tableName protected property

protected $tableName

$whiteList protected property

键值白名单,主要用于获取和设置配置文件某个
protected $whiteList