You are here

public function EasyRdf_Collection::valid in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/easyrdf/easyrdf/lib/EasyRdf/Collection.php \EasyRdf_Collection::valid()

Checks if current position is valid

Return value

bool True if the current position is valid

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Collection.php, line 142

Class

EasyRdf_Collection
Sub-class of EasyRdf_Resource that represents an RDF collection (rdf:List)

Code

public function valid() {
  if ($this->position === 1 and $this
    ->hasProperty('rdf:first')) {
    return true;
  }
  elseif ($this->current !== null and $this->current
    ->hasProperty('rdf:first')) {
    return true;
  }
  else {
    return false;
  }
}