\Lqdt\OrmJson\Model\EntityJsonTrait

This trait adds useful methods to get and set values in JSON fields

Summary

Methods
Properties
Constants
jsonGet()
jsonSet()
jsonIsset()
jsonUnset()
jsonMerge()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
_parse()
$_field
$_path
$_data
N/A

Properties

$_field

$_field : string

Parsed field name

Type

string

$_path

$_path : string

Parsed JSON path

Type

string

$_data

$_data : \Adbar\Dot

field JSON data

Type

\Adbar\Dot

Methods

jsonGet()

jsonGet(string  $datfield, boolean  $assoc = false) : mixed

Get a value inside field JSON data

Parameters

string $datfield

Datfield

boolean $assoc

Returns associative array if true instead of an object

Returns

mixed —

Field value

jsonSet()

jsonSet(string  $datfield, mixed  $value = null) : self

Set a value inside field JSON data

Parameters

string $datfield

Dafield

mixed $value

[description]

Returns

self —

[description]

jsonIsset()

jsonIsset(string  $datfield) : boolean

Check if a key exists within path

Parameters

string $datfield

Datfield

Returns

boolean —

true if key exists

jsonUnset()

jsonUnset(string|array  $datfield) : self

Delete a key from JSON data

Parameters

string|array $datfield

Datfield

Returns

self

jsonMerge()

jsonMerge() : self

Merge new json values into fields when called after patchEntity

Returns

self

_parse()

_parse(string  $datfield) 

Parse a datfield and populates private properties

Parameters

string $datfield

Datfield name notation