Class ResIterator

Description

Implementation of a resource iterator.

This Iterator should be used in a for-loop like: $it = $ontClass->listInstances(); for ($it->rewind(); $it->valid(); $it->next()) { $currentResource=$it->current(); };

Located in /resModel/ResIterator.php (line 29)


	
			
Variable Summary
Method Summary
ResIterator ResIterator (object ResResource $subject, object ResResource $predicate, object ResResource $object, string $getSPO,  &$associatedModel, [string $returnType = false], object ResModel $associatedModel)
mixed current ()
integer key ()
void next ()
void rewind ()
void setFindLiteralWithLang (mixed $language)
boolean valid ()
object resResource _getNextResource ()
object ResResource _getResourceAs (mixed $resource)
Variables
object Model $associatedModel (line 36)

Holds a reference to the assoiated ResModel / OntModel

  • access: private
obejct $currentResource (line 57)

The current resource

  • var: ResResource
  • access: private
string $findLiteralWithLang (line 104)

If set, each resource will first be checked, if it's language fits.

  • access: private
string $getSPO (line 87)

If the resource, we're intrested in is the subject (s), predicate(p), or object (o) of the found statements

  • access: private
integer $key (line 43)

The current position

  • access: private
string $returnType (line 95)

Defines the type of resource, we'd like to receive.

  • access: private
object ResResource $searchObject (line 78)

The object to search for.

  • access: private
object ResResource $searchPredicate (line 71)

The predicate to search for.

  • access: private
object ResResource $searchSubject (line 64)

The subject to search for.

  • access: private
boolean $valid (line 50)

If the current resource is valid

  • access: private
Methods
Constructor ResIterator (line 125)

Constructor.

$subject, $predicate, and $object are used like inf find(). $getSPO supports the strings 's', 'p', and 'o' to return either the subject, predicate, or object of the result statements. $returnType supports the strings 'ResProperty', 'ResLiteral', 'OntProperty', 'OntClass', and 'Individual' and returns the resources as the matching type.

  • access: public
ResIterator ResIterator (object ResResource $subject, object ResResource $predicate, object ResResource $object, string $getSPO,  &$associatedModel, [string $returnType = false], object ResModel $associatedModel)
current (line 175)

Returns the current item

  • access: public
mixed current ()
key (line 238)

Returns the key of the current item

  • access: public
integer key ()
next (line 163)

Moves Iterator to the next item in the list

  • access: public
void next ()
rewind (line 141)

Resets iterator list to start

  • access: public
void rewind ()
setFindLiteralWithLang (line 250)

Sets that only Literals with the matching language should be returned

  • access: public
void setFindLiteralWithLang (mixed $language)
valid (line 153)

Says if there are additional items left in the list

  • access: public
boolean valid ()
_getNextResource (line 187)

Returns the next Resource (subject, predicate, or object of the next matching statement).

  • access: private
object resResource _getNextResource ()
_getResourceAs (line 263)

Returns the $resource as an instance of the type specified in $this->returnType.

  • access: private
object ResResource _getResourceAs (mixed $resource)

Documentation generated on Mon, 26 Jun 2006 14:26:06 +0200 by phpDocumentor 1.3.0RC6