class RdsPersist

Redis 持久化数据

Traits

AppTrait

Constants

TYPE_INSERT

TYPE_UPDATE

Properties

protected Resp $error error from  AppTrait
protected Resp $success success from  AppTrait

Methods

getError()

获取错误

from  AppTrait
bool
setError(string|MessageBag $error)

设置错误

from  AppTrait
getSuccess()

Get success messages;

from  AppTrait
bool
setSuccess(Resp|string $success)

No description

from  AppTrait
static array
where($table, array $where = [])

获取当前缓存的 where 条件的数据

static 
exec()

将redis中的所有数据持久化到数据库 执行将所有表的数据都写入数据库中可使用该方法

static 
execTable(string $table = '')

将redis中的指定表的数据持久化到数据库 单独持久化某个表的时候可以使用该方法

static array
calcUpdate(array $former = [], array $update = [])

进行库的更新计算

static 
update(string $table = '', array $where = [], array $update = [])

修改队列中的数据,根据条件没有找到的话就创建一条

static bool
insert(string $table = '', array $values = [])

往队列中插入一条数据

Details

in AppTrait at line 32
Resp getError()

获取错误

Return Value

Resp

in AppTrait at line 45
bool setError(string|MessageBag $error)

设置错误

Parameters

string|MessageBag $error error

Return Value

bool

in AppTrait at line 82
Resp getSuccess()

Get success messages;

Return Value

Resp

in AppTrait at line 100
bool setSuccess(Resp|string $success)

No description

Parameters

Resp|string $success 设置的成功信息

Return Value

bool

at line 40
static array where($table, array $where = [])

获取当前缓存的 where 条件的数据

Parameters

$table
array $where

Return Value

array

at line 61
static exec()

将redis中的所有数据持久化到数据库 执行将所有表的数据都写入数据库中可使用该方法

at line 93
static execTable(string $table = '')

将redis中的指定表的数据持久化到数据库 单独持久化某个表的时候可以使用该方法

Parameters

string $table

Exceptions

TransactionException

at line 107
static array calcUpdate(array $former = [], array $update = [])

进行库的更新计算

Parameters

array $former
array $update

Return Value

array

at line 165
static update(string $table = '', array $where = [], array $update = [])

修改队列中的数据,根据条件没有找到的话就创建一条

Parameters

string $table 数据表名称
array $where 查询条件(一维数组)
array $update

修改条件(一维数组)
此 update 条件支持 [+] 数据 + , [.] 数据组合, [>] 数据保留之前, [<] 将之前的数据覆盖

Exceptions

ApplicationException

at line 219
static bool insert(string $table = '', array $values = [])

往队列中插入一条数据

Parameters

string $table 数据表名称
array $values 需要插入的数据

Return Value

bool