\CJAX\CoreXmlItem

The XmlItem class that handles fetching/saving XML data for AJAX request.

Summary

Methods
Properties
Constants
__construct()
attach()
callback()
delete()
next()
xml()
__set()
__call()
$selector
$id
$name
$type
$buffer
$cache
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$coreEvents
$api
N/A

Properties

$selector

$selector : string

The selector property, defines the name of selector method.

Type

string

$id

$id : string

The id property, specifies the element ID associated with XmlItem.

Type

string

$name

$name : string

The name property, specifies the element name associated with XmlItem.

Type

string

$type

$type : string

The type property, defines the element type associated with XmlItem.

Type

string

$buffer

$buffer : mixed

The buffer property, stores any extra data that can be added through the xml item to other Exec events.

Type

mixed

$cache

$cache : array

The cache property, stores cache used for AJAX requests.

Type

array

$coreEvents

$coreEvents : \CJAX\Core\CoreEvents

The coreEvents property, stores an instance of injected CoreEvents object.

Type

\CJAX\Core\CoreEvents

$api

$api : array

The api property, defines a list of available selector methods for XmlItem.

Type

array

Methods

__construct()

__construct(\CJAX\Core\CoreEvents  $coreEvents, string  $xmlId, string  $name = null, string  $type = null) : \CJAX\Core\XmlItem

The constructor for XmlItem class, creates an instance of XmlItem object.

Parameters

\CJAX\Core\CoreEvents $coreEvents
string $xmlId
string $name
string $type

Returns

\CJAX\Core\XmlItem

attach()

attach(array  $callbacks) : void

The attach method, adds a list of callback methods to this XmlItem.

Parameters

array $callbacks

callback()

callback(object  $xmlObj, mixed  $fn = null) : void

The callback method, adds a callback to XmlItem.

Parameters

object $xmlObj
mixed $fn

delete()

delete() : void

The delete method, removes this XmlItem from CJAX cache so it won't be available for AJAX request.

next()

next(object  $xmlObj) : void

The next method, fetches the next available Xml object.

Parameters

object $xmlObj

xml()

xml(string  $id = null) : object

The xml method, retrieves an Xml object from CoreEvents' cache list.

Parameters

string $id

Returns

object

__set()

__set(string  $setting, mixed  $value) : void

The magic method __set, dynamically creates properties for XmlItem class.

Parameters

string $setting
mixed $value

__call()

__call(string  $fn, array  $args) : void

The magic method __call, allows CJAX to call custom javascript function from PHP.

Parameters

string $fn
array $args