| Conditions | 2 |
| Paths | 2 |
| Total Lines | 21 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 22 | public function handler($callable) |
||
| 23 | { |
||
| 24 | // If normal handler is passed |
||
| 25 | if (is_callable($callable)) { |
||
| 26 | // Add handler |
||
| 27 | $this->handlers[] = $callable; |
||
| 28 | |||
| 29 | // Get passed arguments |
||
| 30 | $args = func_get_args(); |
||
| 31 | |||
| 32 | // Remove first argument |
||
| 33 | array_shift($args); |
||
| 34 | |||
| 35 | // Add handler parameters stack |
||
| 36 | $this->params[] = &$args; |
||
| 37 | } else { |
||
| 38 | //e('Cannot set Query handler - function(##) does not exists', E_SAMSON_ACTIVERECORD_ERROR, $callable); |
||
| 39 | } |
||
| 40 | |||
| 41 | return $this; |
||
| 42 | } |
||
| 43 | |||
| 59 | } |