public function EasyRdf_Container::count in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/easyrdf/easyrdf/lib/EasyRdf/Container.php \EasyRdf_Container::count()
Counts the number of items in the container
Note that this is an slow method - it is more efficient to use the iterator interface, if you can.
Return value
integer The number of items in the container
File
- vendor/
easyrdf/ easyrdf/ lib/ EasyRdf/ Container.php, line 137
Class
- EasyRdf_Container
- Sub-class of EasyRdf_Resource that represents an RDF container (rdf:Alt, rdf:Bag and rdf:Seq)
Code
public function count() {
$pos = 1;
while ($this
->hasProperty('rdf:_' . $pos)) {
$pos++;
}
return $pos - 1;
}