You are here

protected function EasyRdf_Graph::deleteInverse in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php \EasyRdf_Graph::deleteInverse()

This function is for internal use only.

Deletes an inverse property from a resource.

@ignore

1 call to EasyRdf_Graph::deleteInverse()
EasyRdf_Graph::deleteSingleProperty in vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php
Delete a property (or optionally just a specific value)

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php, line 1160

Class

EasyRdf_Graph
Container for collection of EasyRdf_Resources.

Code

protected function deleteInverse($resource, $property, $value) {
  if (isset($this->revIndex[$resource])) {
    foreach ($this->revIndex[$resource][$property] as $k => $v) {
      if ($v['value'] === $value) {
        unset($this->revIndex[$resource][$property][$k]);
      }
    }
    if (count($this->revIndex[$resource][$property]) == 0) {
      unset($this->revIndex[$resource][$property]);
    }
    if (count($this->revIndex[$resource]) == 0) {
      unset($this->revIndex[$resource]);
    }
  }
}