Permalink
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...
1 parent 674a529 commit 164863a587eea6f143593bec137dad6edefb3749 Lukas Smith committed Dec 28, 2004
Showing with 12 additions and 3 deletions.
  1. +12 −3 RDF/Statement.php
View
@@ -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;
}

0 comments on commit 164863a

Please sign in to comment.