PHP Class FluentDOM\Query\Data

Inheritance: implements IteratorAggregate, implements Countable
Datei anzeigen Open project: fluentdom/fluentdom

Public Methods

Method Description
__construct ( DOMElement $node ) Create object with attached element node.
__get ( string $name ) : mixed Read a data attribute from the attached node.
__isset ( string $name ) : boolean Validate if the attached node has the data attribute.
__set ( string $name, mixed $value ) Change a data attribute on the attached node.
__unset ( string $name ) Remove a data attribute from the attached node.
count ( ) : integer countable Interface: return the number of data attributes
getIterator ( ) : Iterator IteratorAggregate Interface: allow to iterate the data attributes
toArray ( ) : array Convert data attributes into an array

Private Methods

Method Description
decodeName ( string $name ) : string Convert the given attribute name with hyphens to camel case.
decodeValue ( string $value ) : mixed Decode the attribute value into a php variable/array/object
encodeName ( string $name ) : string Normalize a property name from camel case to lowercase with hyphens.
encodeValue ( mixed $value ) : string Encode php variable into a string. Array or Objects will be serialized using json encoding.
isDataProperty ( string $name ) : boolean Validate if the given attribute name is a data property name

Method Details

__construct() public method

Create object with attached element node.
public __construct ( DOMElement $node )
$node DOMElement

__get() public method

Read a data attribute from the attached node.
public __get ( string $name ) : mixed
$name string
return mixed

__isset() public method

Validate if the attached node has the data attribute.
public __isset ( string $name ) : boolean
$name string
return boolean

__set() public method

Change a data attribute on the attached node.
public __set ( string $name, mixed $value )
$name string
$value mixed

__unset() public method

Remove a data attribute from the attached node.
public __unset ( string $name )
$name string

count() public method

countable Interface: return the number of data attributes
public count ( ) : integer
return integer

getIterator() public method

IteratorAggregate Interface: allow to iterate the data attributes
public getIterator ( ) : Iterator
return Iterator

toArray() public method

Convert data attributes into an array
public toArray ( ) : array
return array