* @param array $params
*/
function civicrm_api3_job_delete($params) {
- _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
+ return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
$params['only_active_membership_types']['type'] = CRM_Utils_Type::T_BOOLEAN;
$params['exclude_membership_status_ids']['title'] = 'Exclude membership status IDs from calculations';
$params['exclude_membership_status_ids']['description'] = 'Default: Exclude Pending, Cancelled, Expired. Deceased will always be excluded';
+ $params['exclude_membership_status_ids']['type'] = CRM_Utils_Type::T_INT;
+ $params['exclude_membership_status_ids']['pseudoconstant'] = [
+ 'table' => 'civicrm_membership_status',
+ 'keyColumn' => 'id',
+ 'labelColumn' => 'label',
+ ];
}
/**
/**
* Metadata for batch merge function.
*
- * @param $params
+ * @param array $params
*/
function _civicrm_api3_job_process_batch_merge_spec(&$params) {
$params['rule_group_id'] = [
/**
* Flush smart groups caches.
*
- * This job purges aged smart group cache data (based on the timeout value). Sites can decide whether they want this
- * job and / or the group cache rebuild job to run. In some cases performance is better when old caches are cleared out
- * prior to any attempt to rebuild them. Also, many sites are very happy to have caches built on demand, provided the
- * user is not having to wait for deadlocks to clear when invalidating them.
+ * This job purges aged smart group cache data (based on the timeout value).
+ * Sites can decide whether they want this job and / or the group cache rebuild
+ * job to run. In some cases performance is better when old caches are cleared
+ * out prior to any attempt to rebuild them. Also, many sites are very happy to
+ * have caches built on demand, provided the user is not having to wait for
+ * deadlocks to clear when invalidating them.
*
* @param array $params
*
* @return array
- * @throws \API_Exception
+ * @throws \CiviCRM_API3_Exception
*/
-function civicrm_api3_job_group_cache_flush($params) {
+function civicrm_api3_job_group_cache_flush(array $params): array {
CRM_Contact_BAO_GroupContactCache::deterministicCacheFlush();
return civicrm_api3_create_success();
}
+/**
+ * Flush acl caches.
+ *
+ * This job flushes the acl cache. For many sites it is better to do
+ * this by cron (or not at all if acls are not used) than whenever
+ * a contact is edited.
+ *
+ * @param array $params
+ *
+ * @return array
+ *
+ * @throws \CiviCRM_API3_Exception
+ */
+function civicrm_api3_job_acl_cache_flush(array $params): array {
+ CRM_ACL_BAO_Cache::resetCache();
+ return civicrm_api3_create_success();
+}
+
/**
* Check for CiviCRM software updates.
*