Merge pull request #4004 from civicrm/4.4
[civicrm-core.git] / CRM / Admin / Form / Job.php
index c9ec3be713e0e7acf0d5f8ed744f048197088034..5552856c313cb7208b756f379a4848598a967bff 100644 (file)
@@ -64,6 +64,8 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form {
   /**
    * Function to build the form
    *
+   * @param bool $check
+   *
    * @return void
    * @access public
    */
@@ -106,6 +108,12 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form {
     $this->addFormRule(array('CRM_Admin_Form_Job', 'formRule'));
   }
 
+  /**
+   * @param $fields
+   *
+   * @return array|bool
+   * @throws API_Exception
+   */
   static function formRule($fields) {
 
     $errors = array();
@@ -114,7 +122,7 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form {
 
     /** @var \Civi\API\Kernel $apiKernel */
     $apiKernel = \Civi\Core\Container::singleton()->get('civi_api_kernel');
-    $apiRequest = $apiKernel->createRequest($fields['api_entity'], $fields['api_action'], array('version' => 3), NULL);
+    $apiRequest = \Civi\API\Request::create($fields['api_entity'], $fields['api_action'], array('version' => 3), NULL);
     try {
       $apiKernel->resolve($apiRequest);
     } catch (\Civi\API\Exception\NotImplementedException $e) {
@@ -128,6 +136,9 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form {
     return empty($errors) ? TRUE : $errors;
   }
 
+  /**
+   * @return array
+   */
   function setDefaultValues() {
     $defaults = array();