/** * Return the current statement or NULL if the stream is no longer valid. * * @return LibRDF_Statement The current statement on the iterator * @access public */ public function current() { if ($this->isvalid and !librdf_stream_end($this->stream)) { // the pointer returned is overwritten when the stream is // advanced or closed, so make a copy of the statement $ret = librdf_stream_get_object($this->stream); if ($ret) { return new LibRDF_Statement(librdf_new_statement_from_statement($ret)); } else { throw new LibRDF_Error("Unable to get current statement"); } } else { return NULL; } }
/** * Clone a Statement * * @return void * @throws LibRDF_Error If unable to create a new statement * @access public */ public function __clone() { $this->statement = librdf_new_statement_from_statement($this->statement); if (!$this->statement) { throw new LibRDF_Error("Unable to create new statement from statement"); } }