PHP Класс FluentDOM\Query\Attributes

It acts like the FluentDOM\Query::attr() method. If you read attributes it uses the first selected node. Write actions are applied to all matches element nodes.
Наследование: implements ArrayAccess, implements Countable, implements IteratorAggregate
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( Query $fd ) Store the FluentDOM instance for later use
count ( ) : integer Get the attribute count of the first selected node
getIterator ( ) : Iterator Get an iterator for the attributes of the first node
offsetExists ( string $name ) : boolean Check if the first selected node has the specified attribute
offsetGet ( string $name ) : string Read the specified attribute from the first node
offsetSet ( string $name, string $value ) Set the attribute on all selected element nodes
offsetUnset ( string | array $name ) Remove the attribute(s) on all selected element nodes
toArray ( ) : array Convert the attributes of the first node into an array

Приватные методы

Метод Описание
getFirstElement ( ) : DOMElement | null

Описание методов

__construct() публичный Метод

Store the FluentDOM instance for later use
public __construct ( Query $fd )
$fd FluentDOM\Query

count() публичный Метод

Get the attribute count of the first selected node
См. также: Countable::count()
public count ( ) : integer
Результат integer

getIterator() публичный Метод

Get an iterator for the attributes of the first node
См. также: IteratorAggregate::getIterator()
public getIterator ( ) : Iterator
Результат Iterator

offsetExists() публичный Метод

Check if the first selected node has the specified attribute
См. также: ArrayAccess::offsetExists()
public offsetExists ( string $name ) : boolean
$name string
Результат boolean

offsetGet() публичный Метод

Read the specified attribute from the first node
См. также: ArrayAccess::offsetGet()
См. также: FluentDOM::attr()
public offsetGet ( string $name ) : string
$name string
Результат string

offsetSet() публичный Метод

Set the attribute on all selected element nodes
См. также: ArrayAccess::offsetSet()
См. также: FluentDOM::attr()
public offsetSet ( string $name, string $value )
$name string
$value string

offsetUnset() публичный Метод

Remove the attribute(s) on all selected element nodes
См. также: ArrayAccess::offsetUnset()
См. также: FluentDOM::removeAttr()
public offsetUnset ( string | array $name )
$name string | array

toArray() публичный Метод

Convert the attributes of the first node into an array
public toArray ( ) : array
Результат array