示例#1
0
 protected function _checkParams(array $params)
 {
     $checks = \MUtil_Ra::nonScalars($params);
     if ($this->_allowedClasses) {
         $checks = \MUtil_Ra::nonScalars($params);
         if (is_array($checks)) {
             foreach ($checks as $object) {
                 if (!$this->_allowedClasses->get($object)) {
                     $name = get_class($object);
                     $method = reset($params);
                     throw new \MUtil_Batch_BatchException("Not allowed batch class {$name} parameter for method: '{$method}'.");
                 }
             }
         }
     } elseif (!\MUtil_Ra::isScalar($params)) {
         $checks = \MUtil_Ra::nonScalars($params);
         if (is_array($checks)) {
             $object = reset($checks);
             $name = get_class($object);
             $method = reset($params);
             throw new \MUtil_Batch_BatchException("Not allowed batch class {$name} parameter for method: '{$method}'.");
         }
     }
 }