dataStore
in package
Manages persistent key-value storage for Jeedom components
Tags
Table of Contents
Properties
Methods
- byId() : static|null
- Retrieves a dataStore instance by its ID
- byTypeLinkId() : array<string|int, static>
- Retrieves all dataStore instances for a component type and optional link ID
- byTypeLinkIdKey() : static|null
- Retrieves a dataStore instance by its type, linked ID and key
- getChanged() : bool
- getId() : int
- getKey() : string
- getLink_id() : int
- getLinkData() : array<string, string|float|array<string, array<string, mixed>>>|void
- Builds graph data for component dependencies
- getType() : string
- getUsedBy() : array<string, array<string|int, mixed>>
- Lists components using this instance
- getValue() : mixed
- postSave() : void
- Executes post-save operations
- preSave() : bool
- Validates instance data before saving
- remove() : void
- Removes the instance from database
- removeByTypeLinkId() : bool
- Removes all dataStore instances for a component type and link ID
- save() : bool
- Persists the instance to database
- setChanged() : static
- setId() : static
- setKey() : static
- setLink_id() : static
- setType() : static
- setValue() : static
Properties
$_changed
private
bool
$_changed
Change tracking flag
$id
private
int
$id
Unique identifier
$key
private
string
$key
Storage key identifier
$link_id
private
int
$link_id
Related component identifier
$type
private
string
$type
Type of related component (cmd, object, eqLogic, scenario)
$value
private
scalar
$value
Stored value
Methods
byId()
Retrieves a dataStore instance by its ID
public
static byId(int $_id) : static|null
Parameters
- $_id : int
-
Instance identifier
Tags
Return values
static|null —Found instance or null
byTypeLinkId()
Retrieves all dataStore instances for a component type and optional link ID
public
static byTypeLinkId(string $_type[, int|string $_link_id = '' ]) : array<string|int, static>
Parameters
- $_type : string
-
Component type
- $_link_id : int|string = ''
-
Optional component identifier
Tags
Return values
array<string|int, static> —Array of matching instances
byTypeLinkIdKey()
Retrieves a dataStore instance by its type, linked ID and key
public
static byTypeLinkIdKey(string $_type, int $_link_id, string $_key) : static|null
Parameters
- $_type : string
-
Component type
- $_link_id : int
-
Component identifier
- $_key : string
-
Storage key
Return values
static|null —Found instance or null
getChanged()
public
getChanged() : bool
Return values
boolgetId()
public
getId() : int
Return values
intgetKey()
public
getKey() : string
Return values
stringgetLink_id()
public
getLink_id() : int
Return values
intgetLinkData()
Builds graph data for component dependencies
public
getLinkData([array<string, array<string, array<string, mixed>>> &$_data = array('node' => array(), 'link' => array()) ][, int $_level = 0 ][, int|null $_drill = null ]) : array<string, string|float|array<string, array<string, mixed>>>|void
Parameters
- $_data : array<string, array<string, array<string, mixed>>> = array('node' => array(), 'link' => array())
-
Existing graph data
- $_level : int = 0
-
Current graph level
- $_drill : int|null = null
-
Maximum drill level
Return values
array<string, string|float|array<string, array<string, mixed>>>|void —Graph data structure
getType()
public
getType() : string
Return values
stringgetUsedBy()
Lists components using this instance
public
getUsedBy([bool $_array = false ]) : array<string, array<string|int, mixed>>
Parameters
- $_array : bool = false
-
Convert objects to arrays
Return values
array<string, array<string|int, mixed>> —List of dependent components
getValue()
public
getValue([mixed $_default = '' ]) : mixed
Parameters
- $_default : mixed = ''
-
Default value if none stored
postSave()
Executes post-save operations
public
postSave() : void
Tags
preSave()
Validates instance data before saving
public
preSave() : bool
Tags
Return values
bool —Validation status
remove()
Removes the instance from database
public
remove() : void
removeByTypeLinkId()
Removes all dataStore instances for a component type and link ID
public
static removeByTypeLinkId(string $_type, int $_link_id) : bool
Parameters
- $_type : string
-
Component type
- $_link_id : int
-
Component identifier
Tags
Return values
bool —Success status
save()
Persists the instance to database
public
save() : bool
Return values
bool —Success status
setChanged()
public
setChanged(bool $_changed) : static
Parameters
- $_changed : bool
Return values
staticsetId()
public
setId(int $_id) : static
Parameters
- $_id : int
Return values
staticsetKey()
public
setKey(string $_key) : static
Parameters
- $_key : string
Return values
staticsetLink_id()
public
setLink_id(int $_link_id) : static
Parameters
- $_link_id : int
Return values
staticsetType()
public
setType(string $_type) : static
Parameters
- $_type : string
Return values
staticsetValue()
public
setValue(object|array<string|int, mixed>|scalar $_value) : static
Parameters
- $_value : object|array<string|int, mixed>|scalar