You are here

public function EasyRdf_Container::offsetUnset in Zircon Profile 8.0

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

Array Access: delete an item at a specific postion using array syntax

Example: unset($seq[2]);

Warning: creating gaps in the sequence will result in unexpected behavior

File

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

Class

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

Code

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