Source for file IterFind.php
Documentation is available at IterFind.php
// ----------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------
* Implementation of a find-iterator which delivers statements or quads.
* This Iterator should be used in a for-loop like:
* for($iterator = $memmodel->iterFind(null,null,null,null); $iterator->valid(); $iterator->next())
* $statement=$iterator->current();
* @version $Id: fsource_utility__utilIterFind.php.html 443 2007-06-01 16:25:38Z cax $
* @author Daniel Westphal (http://www.d-westphal.de)
* boolean value, if the results should be returned as Quads
* If the current resource is valid
* The subject Resource to search for
* The predicate Resource to search for
* The object Resource to search for
* $subject, $predicate, and $object are used like find().
* $graph has to be a reference to the graph to search in.
* @param $subject Resource
* @param $predicate Resource
* @param $object Resource
* @param $returnAsQuads boolean
function IterFind($graph,$subject,$predicate,$object,$returnAsQuads=
false)
$this->findGraph=
&$graph;
$this->findSubject=
$subject;
$this->findPredicate=
$predicate;
$this->findObject=
$object;
$this->returnAsQuads=
$returnAsQuads;
* Resets iterator list to start
* Says if there are additional items left in the list
* Moves Iterator to the next item in the list
$this->current =
$this->findGraph->findFirstMatchingStatement($this->findSubject,$this->findPredicate,$this->findObject,++
$this->key);
$this->valid=
($this->current!=
NULL);
* Returns the current item
return new Quad(new Resource($this->findGraph->getGraphName()),$this->current->getSubject(),$this->current->getPredicate(),$this->current->getObject());
* Returns the key of the current item
Documentation generated on Fri, 1 Jun 2007 16:49:38 +0200 by phpDocumentor 1.3.2