Permalink
Browse files

Allowing ValidateException to be instantiated without arguments

  • Loading branch information...
1 parent 1ed646f commit 2a2bee768c898e7541a5b2db74c553b46c29039d @mariano committed May 14, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 models/ValidateException.php
@@ -5,7 +5,11 @@ class ValidateException extends \Exception {
protected $entity;
protected $errors;
- public function __construct($entity) {
+ public function __construct($entity = null) {
+ if (empty($entity)) {
+ return parent::__construct();
+ }
+
if ($entity instanceof BaseEntity) {
$this->entity = $entity;
$this->errors = $entity->errors();

0 comments on commit 2a2bee7

Please sign in to comment.