Browse Source

check for contraints before executing it

develop
Robin Thoni 9 years ago
parent
commit
e6478d3a6d
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      src/Utils/Dbo/LuDbo.php

+ 4
- 0
src/Utils/Dbo/LuDbo.php View File

152
 
152
 
153
     /**
153
     /**
154
      * @param $constraints LuParameterConstraintDbo[]
154
      * @param $constraints LuParameterConstraintDbo[]
155
+     * @throws LuDboConstraintException
155
      */
156
      */
156
     public function checkConstraints($constraints) {
157
     public function checkConstraints($constraints) {
157
         foreach ($constraints as $constraint) {
158
         foreach ($constraints as $constraint) {
159
+            if (!is_callable([$this, $constraint->getMethod()])) {
160
+                throw new LuDboConstraintException("Constraint '" . $constraint->getMethod() . "' could not be found");
161
+            }
158
             call_user_func_array([$this, $constraint->getMethod()], $constraint->getArguments());
162
             call_user_func_array([$this, $constraint->getMethod()], $constraint->getArguments());
159
         }
163
         }
160
     } 
164
     } 

Loading…
Cancel
Save