Skip to content

Commit

Permalink
Added hasErrors() helper method to Transaction and PaymentMethod clas…
Browse files Browse the repository at this point in the history
…ses.
  • Loading branch information
tisho committed Dec 5, 2011
1 parent 88bb137 commit e52e312
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Samurai/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,14 @@ private function sanitizedAttributes() {
return $attr;
}

/*
* Checks if there are any errors in the $errors array
*/

public function hasErrors() {
return !empty($this->errors);
}

/* -- Accessors -- */

/*
Expand Down
8 changes: 8 additions & 0 deletions lib/Samurai/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,14 @@ public function updateAttributes($attributes = array()) {
}
}

/*
* Checks if there are any errors in the $errors array
*/

public function hasErrors() {
return !empty($this->errors);
}

/* -- Accessors -- */

/*
Expand Down

0 comments on commit e52e312

Please sign in to comment.