Antidot PHP API  version 0.16.0
##PHP API to simplify integration of Antidot components
 All Classes Files Functions Variables Groups Pages
Public Member Functions | List of all members
JsonStore Class Reference

Public Member Functions

 __construct ($data)
 setData ($data)
 toString ()
 toObject ()
 toArray ()
 get ($expr, $unique=false)
 set ($expr, $value)
 add ($parentexpr, $value, $name="")
 remove ($expr)

Constructor & Destructor Documentation

__construct (   $data)
Parameters
string | array | \stdClass$data

Member Function Documentation

add (   $parentexpr,
  $value,
  $name = "" 
)

Adds one or more elements matching the given json path expression

Parameters
string$parentexprJsonPath expression to the parent
mixed$valueValue to add
string$nameKey name
Returns
bool returns true if success
get (   $expr,
  $unique = false 
)

Gets elements matching the given JsonPath expression

Parameters
string$exprJsonPath expression
bool$uniqueGets unique results or not
Returns
array
remove (   $expr)

Removes all elements matching the given jsonpath expression

Parameters
string$exprJsonPath expression
Returns
bool returns true if success
set (   $expr,
  $value 
)

Sets the value for all elements matching the given JsonPath expression

Parameters
string$exprJsonPath expression
mixed$valueValue to set
Returns
bool returns true if success
setData (   $data)

Sets JsonStore's manipulated data

Parameters
string | array | \stdClass$data
toArray ( )

Returns the given json string to array

Returns
array
toObject ( )

Returns the given json string to object

Returns
toString ( )

JsonEncoded version of the object

Returns
string