Jeedom Core

dataStore
in package

Manages persistent key-value storage for Jeedom components

Tags
see
cmd
see
scenario
see
eqLogic

Table of Contents

Properties

$_changed  : bool
$id  : int
$key  : string
$link_id  : int
$type  : string
$value  : scalar

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

$type

private string $type

Type of related component (cmd, object, eqLogic, scenario)

Methods

byId()

Retrieves a dataStore instance by its ID

public static byId(int $_id) : static|null
Parameters
$_id : int

Instance identifier

Tags
throws
Exception

If database error occurs

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
throws
Exception

If database error occurs

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

getLinkData()

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

getUsedBy()

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
throws
Exception

If post-save operations fail

preSave()

Validates instance data before saving

public preSave() : bool
Tags
throws
Exception

If validation fails

Return values
bool

Validation status

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
throws
Exception

If removal fails

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
static

setId()

public setId(int $_id) : static
Parameters
$_id : int
Return values
static

setKey()

public setKey(string $_key) : static
Parameters
$_key : string
Return values
static
public setLink_id(int $_link_id) : static
Parameters
$_link_id : int
Return values
static

setType()

public setType(string $_type) : static
Parameters
$_type : string
Return values
static

setValue()

public setValue(object|array<string|int, mixed>|scalar $_value) : static
Parameters
$_value : object|array<string|int, mixed>|scalar
Return values
static

        
On this page

Search results