Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- added error handling into the factory method

git-svn-id: http://svn.php.net/repository/pear/packages/RDF/trunk@175798 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
commit 164863a587eea6f143593bec137dad6edefb3749 1 parent 674a529
Lukas Smith authored
Showing with 12 additions and 3 deletions.
  1. +12 −3 RDF/Statement.php
View
15 RDF/Statement.php
@@ -50,9 +50,18 @@ function factory($subj, $pred, $obj)
{
$statement = new RDF_Statement;
- $statement->setSubject($subj);
- $statement->setPredicate($pred);
- $statement->setObject($obj);
+ $return = $statement->setSubject($subj);
+ if (PEAR::isError($return)) {
+ return $return;
+ }
+ $return = $statement->setPredicate($pred);
+ if (PEAR::isError($return)) {
+ return $return;
+ }
+ $return = $statement->setObject($obj);
+ if (PEAR::isError($return)) {
+ return $return;
+ }
return $statement;
}
Please sign in to comment.
Something went wrong with that request. Please try again.