X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FBAO%2FJob.php;h=db5e6d7278ee5fd1207cbef03778a9b6cbdfaf09;hb=7fce4915eecc80f9f693a490548d579c1ca6aec6;hp=928d090f523f483ceb64a31108041d84160d7673;hpb=23e35f75793a63e1c50249d322bcf1f2439415f8;p=civicrm-core.git diff --git a/CRM/Core/BAO/Job.php b/CRM/Core/BAO/Job.php index 928d090f52..db5e6d7278 100644 --- a/CRM/Core/BAO/Job.php +++ b/CRM/Core/BAO/Job.php @@ -1,7 +1,7 @@ copyValues($params); return $job->save(); } /** - * Takes a bunch of params that are needed to match certain criteria and - * retrieves the relevant objects. It also stores all the retrieved - * values in the default array + * Retrieve DB object based on input parameters. + * + * It also stores all the retrieved values in the default array. * - * @param array $params (reference ) an assoc array of name/value pairs - * @param array $defaults (reference ) an assoc array to hold the flattened values + * @param array $params + * (reference ) an assoc array of name/value pairs. + * @param array $defaults + * (reference ) an assoc array to hold the flattened values. * - * @return CRM_Core_DAO_Job object on success, null otherwise - * @access public - * @static + * @return CRM_Core_DAO_Job|null + * object on success, null otherwise */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $job = new CRM_Core_DAO_Job(); $job->copyValues($params); if ($job->find(TRUE)) { @@ -83,30 +83,30 @@ class CRM_Core_BAO_Job extends CRM_Core_DAO_Job { } /** - * update the is_active flag in the db + * Update the is_active flag in the db. * - * @param int $id id of the database record - * @param boolean $is_active value we want to set the is_active field + * @param int $id + * Id of the database record. + * @param bool $is_active + * Value we want to set the is_active field. * - * @return Object DAO object on sucess, null otherwise + * @return Object + * DAO object on sucess, null otherwise * - * @access public - * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Core_DAO_Job', $id, 'is_active', $is_active); } /** - * Function to delete scheduled job + * Function to delete scheduled job. * - * @param $jobID ID of the job to be deleted. + * @param $jobID + * ID of the job to be deleted. * * @return bool|null - * @access public - * @static */ - static function del($jobID) { + public static function del($jobID) { if (!$jobID) { CRM_Core_Error::fatal(ts('Invalid value passed to delete function.')); } @@ -123,17 +123,17 @@ class CRM_Core_BAO_Job extends CRM_Core_DAO_Job { } /** - * Trim job table on a regular basis to keep it at a good size + * Trim job table on a regular basis to keep it at a good size. * * CRM-10513 */ - static function cleanup($maxEntriesToKeep = 1000, $minDaysToKeep = 30) { + public static function cleanup($maxEntriesToKeep = 1000, $minDaysToKeep = 30) { // Prevent the job log from getting too big // For now, keep last minDays days and at least maxEntries records $query = 'SELECT COUNT(*) FROM civicrm_job_log'; $count = CRM_Core_DAO::singleValueQuery($query); - if ( $count <= $maxEntriesToKeep) { + if ($count <= $maxEntriesToKeep) { return; }