You are here

public function EasyRdf_Container::offsetExists in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/easyrdf/easyrdf/lib/EasyRdf/Container.php \EasyRdf_Container::offsetExists()

Array Access: check if a position exists in container using array syntax

Example: isset($seq[2])

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Container.php, line 167

Class

EasyRdf_Container
Sub-class of EasyRdf_Resource that represents an RDF container (rdf:Alt, rdf:Bag and rdf:Seq)

Code

public function offsetExists($offset) {
  if (is_int($offset) and $offset > 0) {
    return $this
      ->hasProperty('rdf:_' . $offset);
  }
  else {
    throw new InvalidArgumentException("Container position must be a positive integer");
  }
}