Documentation

Job.php

This api is used for working with scheduled "cron" jobs.

Table of Contents

Functions

_civicrm_api3_job_create_spec()  : mixed
Adjust metadata for "Create" action.
civicrm_api3_job_create()  : array<string|int, mixed>
Create scheduled job.
_civicrm_api3_job_clone_spec()  : mixed
Adjust metadata for clone spec action.
civicrm_api3_job_clone()  : array<string|int, mixed>
Clone Job.
civicrm_api3_job_get()  : array<string|int, mixed>
Retrieve one or more job.
civicrm_api3_job_delete()  : mixed
Delete a job.
civicrm_api3_job_execute()  : array<string|int, mixed>
Dumb wrapper to execute scheduled jobs.
_civicrm_api3_job_execute_spec()  : mixed
Adjust Metadata for Execute action.
civicrm_api3_job_geocode()  : array<string|int, mixed>
Geocode group of contacts based on given params.
_civicrm_api3_job_geocode_spec()  : mixed
First check on Code documentation.
civicrm_api3_job_send_reminder()  : array<string|int, mixed>
Send the scheduled reminders as configured.
_civicrm_api3_job_send_reminder()  : mixed
Adjust metadata for "send_reminder" action.
civicrm_api3_job_mail_report()  : array<string|int, mixed>
Execute a specific report instance and send the output via email.
civicrm_api3_job_update_greeting()  : array<string|int, mixed>
This method allows to update Email Greetings, Postal Greetings and Addressee for a specific contact type.
_civicrm_api3_job_update_greeting_spec()  : mixed
Adjust Metadata for Get action.
civicrm_api3_job_process_pledge()  : array<string|int, mixed>
Mass update pledge statuses.
civicrm_api3_job_process_mailing()  : array<string|int, mixed>
Process mail queue.
civicrm_api3_job_process_sms()  : array<string|int, mixed>
Process sms queue.
civicrm_api3_job_fetch_bounces()  : array<string|int, mixed>
Job to get mail responses from civiMailing.
_civicrm_api3_job_fetch_bounces_spec()  : mixed
Metadata for bounce function.
civicrm_api3_job_fetch_activities()  : array<string|int, mixed>
Job to get mail and create activities.
civicrm_api3_job_process_participant()  : array<string|int, mixed>
Process participant statuses.
civicrm_api3_job_process_membership()  : bool
This api checks and updates the status of all membership records for a given domain.
_civicrm_api3_job_process_membership_spec()  : mixed
civicrm_api3_job_process_respondent()  : bool
This api checks and updates the status of all survey respondents.
civicrm_api3_job_process_batch_merge()  : array<string|int, mixed>
Merges given pair of duplicate contacts.
_civicrm_api3_job_process_batch_merge_spec()  : mixed
Metadata for batch merge function.
civicrm_api3_job_run_payment_cron()  : mixed
Runs handlePaymentCron method in the specified payment processor.
civicrm_api3_job_cleanup()  : array<string|int, mixed>
This api cleans up all the old session entries and temp tables.
civicrm_api3_job_disable_expired_relationships()  : array<string|int, mixed>
Set expired relationships to disabled.
civicrm_api3_job_group_rebuild()  : array<string|int, mixed>
This api reloads all the smart groups.
civicrm_api3_job_group_cache_flush()  : array<string|int, mixed>
Flush smart groups caches.
civicrm_api3_job_acl_cache_flush()  : array<string|int, mixed>
Flush acl caches.
civicrm_api3_job_version_check()  : mixed
Check for CiviCRM software updates.

Functions

_civicrm_api3_job_create_spec()

Adjust metadata for "Create" action.

_civicrm_api3_job_create_spec(array<string|int, mixed> &$params) : mixed

The metadata is used for setting defaults, documentation & validation.

Parameters
$params : array<string|int, mixed>

Array of parameters determined by getfields.

civicrm_api3_job_create()

Create scheduled job.

civicrm_api3_job_create(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>

Associative array of property name/value pairs to insert in new job.

Return values
array<string|int, mixed>

_civicrm_api3_job_clone_spec()

Adjust metadata for clone spec action.

_civicrm_api3_job_clone_spec(array<string|int, mixed> &$spec) : mixed
Parameters
$spec : array<string|int, mixed>

civicrm_api3_job_clone()

Clone Job.

civicrm_api3_job_clone(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

civicrm_api3_job_get()

Retrieve one or more job.

civicrm_api3_job_get(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>

input parameters

Return values
array<string|int, mixed>

civicrm_api3_job_delete()

Delete a job.

civicrm_api3_job_delete(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>

civicrm_api3_job_execute()

Dumb wrapper to execute scheduled jobs.

civicrm_api3_job_execute(array<string|int, mixed> $params) : array<string|int, mixed>

Always creates success - errors and results are handled in the job log.

Parameters
$params : array<string|int, mixed>

input parameters (unused).

Return values
array<string|int, mixed>

API Result Array

_civicrm_api3_job_execute_spec()

Adjust Metadata for Execute action.

_civicrm_api3_job_execute_spec(array<string|int, mixed> &$params) : mixed
Parameters
$params : array<string|int, mixed>

Array of parameters determined by getfields.

civicrm_api3_job_geocode()

Geocode group of contacts based on given params.

civicrm_api3_job_geocode(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>

input parameters.

Return values
array<string|int, mixed>

API Result Array

_civicrm_api3_job_geocode_spec()

First check on Code documentation.

_civicrm_api3_job_geocode_spec(array<string|int, mixed> &$params) : mixed
Parameters
$params : array<string|int, mixed>

civicrm_api3_job_send_reminder()

Send the scheduled reminders as configured.

civicrm_api3_job_send_reminder(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>
  • now - the time to use, in YmdHis format
  • makes testing a bit simpler since we can simulate past/future time
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

_civicrm_api3_job_send_reminder()

Adjust metadata for "send_reminder" action.

_civicrm_api3_job_send_reminder(array<string|int, mixed> &$params) : mixed

The metadata is used for setting defaults, documentation & validation.

Parameters
$params : array<string|int, mixed>

Array of parameters determined by getfields.

civicrm_api3_job_mail_report()

Execute a specific report instance and send the output via email.

civicrm_api3_job_mail_report(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>

(reference ) input parameters. sendmail - Boolean - should email be sent?, required instanceId - Integer - the report instance ID resetVal - Integer - should we reset form state (always true)?

Return values
array<string|int, mixed>

civicrm_api3_job_update_greeting()

This method allows to update Email Greetings, Postal Greetings and Addressee for a specific contact type.

civicrm_api3_job_update_greeting(array<string|int, mixed> $params) : array<string|int, mixed>

IMPORTANT: You must first create valid option value before using via admin interface. Check option lists for Email Greetings, Postal Greetings and Addressee

Parameters
$params : array<string|int, mixed>
Tags
todo
  • is this here by mistake or should it be added to _spec function :id - Integer - greetings option group.
Return values
array<string|int, mixed>

_civicrm_api3_job_update_greeting_spec()

Adjust Metadata for Get action.

_civicrm_api3_job_update_greeting_spec(array<string|int, mixed> &$params) : mixed

The metadata is used for setting defaults, documentation & validation.

Parameters
$params : array<string|int, mixed>

Array of parameters determined by getfields.

civicrm_api3_job_process_pledge()

Mass update pledge statuses.

civicrm_api3_job_process_pledge(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

civicrm_api3_job_process_mailing()

Process mail queue.

civicrm_api3_job_process_mailing(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>
Return values
array<string|int, mixed>

civicrm_api3_job_process_sms()

Process sms queue.

civicrm_api3_job_process_sms(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>
Return values
array<string|int, mixed>

civicrm_api3_job_fetch_bounces()

Job to get mail responses from civiMailing.

civicrm_api3_job_fetch_bounces(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>
Return values
array<string|int, mixed>

_civicrm_api3_job_fetch_bounces_spec()

Metadata for bounce function.

_civicrm_api3_job_fetch_bounces_spec(array<string|int, mixed> &$params) : mixed
Parameters
$params : array<string|int, mixed>

civicrm_api3_job_fetch_activities()

Job to get mail and create activities.

civicrm_api3_job_fetch_activities(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>
Return values
array<string|int, mixed>

civicrm_api3_job_process_participant()

Process participant statuses.

civicrm_api3_job_process_participant(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>

Input parameters.

Return values
array<string|int, mixed>

array of properties, if error an array with an error id and error message

civicrm_api3_job_process_membership()

This api checks and updates the status of all membership records for a given domain.

civicrm_api3_job_process_membership(array<string|int, mixed> $params) : bool

The function uses the calc_membership_status and update_contact_membership APIs.

IMPORTANT: Sending renewal reminders has been migrated from this job to the Scheduled Reminders function as of 4.3.

Parameters
$params : array<string|int, mixed>

Input parameters NOT USED.

Return values
bool

true if success, else false

_civicrm_api3_job_process_membership_spec()

_civicrm_api3_job_process_membership_spec(mixed &$params) : mixed
Parameters
$params : mixed

civicrm_api3_job_process_respondent()

This api checks and updates the status of all survey respondents.

civicrm_api3_job_process_respondent(array<string|int, mixed> $params) : bool
Parameters
$params : array<string|int, mixed>

(reference ) input parameters.

Return values
bool

true if success, else false

civicrm_api3_job_process_batch_merge()

Merges given pair of duplicate contacts.

civicrm_api3_job_process_batch_merge(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>

Input parameters.

Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

API Result Array

_civicrm_api3_job_process_batch_merge_spec()

Metadata for batch merge function.

_civicrm_api3_job_process_batch_merge_spec(array<string|int, mixed> &$params) : mixed
Parameters
$params : array<string|int, mixed>

civicrm_api3_job_run_payment_cron()

Runs handlePaymentCron method in the specified payment processor.

civicrm_api3_job_run_payment_cron(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>

Input parameters.

Expected @params array keys are: INCORRECTLY DOCUMENTED AND SHOULD BE IN THE _spec function for retrieval via getfields. {string 'processor_name' - the name of the payment processor, eg: Sagepay}

civicrm_api3_job_cleanup()

This api cleans up all the old session entries and temp tables.

civicrm_api3_job_cleanup(array<string|int, mixed> $params) : array<string|int, mixed>

We recommend that sites run this on an hourly basis.

Parameters
$params : array<string|int, mixed>

Sends in various config parameters to decide what needs to be cleaned.

Return values
array<string|int, mixed>

civicrm_api3_job_disable_expired_relationships()

Set expired relationships to disabled.

civicrm_api3_job_disable_expired_relationships(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

civicrm_api3_job_group_rebuild()

This api reloads all the smart groups.

civicrm_api3_job_group_rebuild(array<string|int, mixed> $params) : array<string|int, mixed>

If the org has a large number of smart groups it is recommended that they use the limit clause to limit the number of smart groups evaluated on a per job basis.

Might also help to increase the smartGroupCacheTimeout and use the cache.

Parameters
$params : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

civicrm_api3_job_group_cache_flush()

Flush smart groups caches.

civicrm_api3_job_group_cache_flush(array<string|int, mixed> $params) : array<string|int, mixed>

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.

Parameters
$params : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

civicrm_api3_job_acl_cache_flush()

Flush acl caches.

civicrm_api3_job_acl_cache_flush(array<string|int, mixed> $params) : array<string|int, mixed>

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.

Parameters
$params : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

civicrm_api3_job_version_check()

Check for CiviCRM software updates.

civicrm_api3_job_version_check() : mixed

Anonymous site statistics are sent back to civicrm.org during this check.


        
On this page

Search results