<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
* Class constructor
*
* @param void
- * @access public
- *
+ */
+ /**
*/
public function __construct() {
$config = CRM_Core_Config::singleton();
/*
*
* @param void
- * @access private
- *
+ */
+ /**
+ * @param bool $auth
*/
public function execute($auth = TRUE) {
* Class destructor
*
* @param void
- * @access public
- *
*/
public function __destruct() {}
+ /**
+ * @param $entity
+ * @param $action
+ */
public function executeJobByAction($entity, $action) {
$job = $this->_getJob(NULL, $entity, $action);
$this->executeJob($job);
}
+ /**
+ * @param int $id
+ */
public function executeJobById($id) {
$job = $this->_getJob($id);
$this->executeJob($job);
* populates class param.
*
* @param void
- * @return array ($id => CRM_Core_ScheduledJob)
- * @access private
- *
+ * @return array
+ * ($id => CRM_Core_ScheduledJob)
+ */
+ /**
+ * @return array
*/
private function _getJobs() {
$jobs = array();
* and creates ScheduledJob object.
*
* @param void
- * @access private
+ */
+ /**
+ * @param int $id
+ * @param null $entity
+ * @param null $action
*
+ * @return CRM_Core_ScheduledJob
+ * @throws Exception
*/
private function _getJob($id = NULL, $entity = NULL, $action = NULL) {
if (is_null($id) && is_null($action)) {
return $job;
}
+ /**
+ * @param $entity
+ * @param $job
+ * @param array $params
+ * @param null $source
+ */
public function setSingleRunParams($entity, $job, $params, $source = NULL) {
$this->_source = $source;
$key = strtolower($entity . '_' . $job);
/*
*
* @return array|null collection of permissions, null if none
- * @access public
- *
+ */
+ /**
+ * @param $message
*/
public function logEntry($message) {
$domainID = CRM_Core_Config::domainID();
if ($this->currentJob) {
$dao->job_id = $this->currentJob->id;
$dao->name = $this->currentJob->name;
- $dao->command = ts("Entity:") . " " + $this->currentJob->api_entity + " " . ts("Action:") . " " + $this->currentJob->api_action;
+ $dao->command = ts("Entity:") . " " . $this->currentJob->api_entity . " " . ts("Action:") . " " . $this->currentJob->api_action;
$data = "";
if (!empty($this->currentJob->parameters)) {
$data .= "\n\nParameters raw (from db settings): \n" . $this->currentJob->parameters;
$dao->save();
}
+ /**
+ * @param $apiResult
+ *
+ * @return string
+ */
private function _apiResultToMessage($apiResult) {
$status = $apiResult['is_error'] ? ts('Failure') : ts('Success');
$msg = CRM_Utils_Array::value('error_message', $apiResult, 'empty error_message!');
}
}
+/**
+ * @param $message
+ *
+ * @throws Exception
+ */
function CRM_Core_JobManager_scheduledJobFatalErrorHandler($message) {
throw new Exception("{$message['message']}: {$message['code']}");
}
-