5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/Job.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:143980edb0346c065249ee860efe6b41)
13 * Database access object for the Job entity.
15 class CRM_Core_DAO_Job
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_job';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * Which Domain is this scheduled job for
46 * Scheduled job run frequency.
50 public $run_frequency;
53 * When was this cron entry last run
60 * When is this cron entry scheduled to run
64 public $scheduled_run_date;
74 * Description of the job
81 * Entity of the job api call
88 * Action of the job api call
95 * List of parameters to the command.
102 * Is this job active?
111 public function __construct() {
112 $this->__table
= 'civicrm_job';
113 parent
::__construct();
117 * Returns foreign keys and entity references.
120 * [CRM_Core_Reference_Interface]
122 public static function getReferenceColumns() {
123 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
124 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
125 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
126 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
128 return Civi
::$statics[__CLASS__
]['links'];
132 * Returns all the column names of this table
136 public static function &fields() {
137 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
138 Civi
::$statics[__CLASS__
]['fields'] = [
141 'type' => CRM_Utils_Type
::T_INT
,
142 'title' => ts('Job ID'),
143 'description' => ts('Job Id'),
145 'where' => 'civicrm_job.id',
146 'table_name' => 'civicrm_job',
148 'bao' => 'CRM_Core_BAO_Job',
152 'name' => 'domain_id',
153 'type' => CRM_Utils_Type
::T_INT
,
154 'title' => ts('Job Domain'),
155 'description' => ts('Which Domain is this scheduled job for'),
157 'where' => 'civicrm_job.domain_id',
158 'table_name' => 'civicrm_job',
160 'bao' => 'CRM_Core_BAO_Job',
162 'FKClassName' => 'CRM_Core_DAO_Domain',
163 'pseudoconstant' => [
164 'table' => 'civicrm_domain',
166 'labelColumn' => 'name',
170 'name' => 'run_frequency',
171 'type' => CRM_Utils_Type
::T_STRING
,
172 'title' => ts('Job Frequency'),
173 'description' => ts('Scheduled job run frequency.'),
175 'size' => CRM_Utils_Type
::EIGHT
,
176 'where' => 'civicrm_job.run_frequency',
177 'default' => 'Daily',
178 'table_name' => 'civicrm_job',
180 'bao' => 'CRM_Core_BAO_Job',
185 'pseudoconstant' => [
186 'callback' => 'CRM_Core_SelectValues::getJobFrequency',
190 'name' => 'last_run',
191 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
192 'title' => ts('Last Run'),
193 'description' => ts('When was this cron entry last run'),
195 'where' => 'civicrm_job.last_run',
197 'table_name' => 'civicrm_job',
199 'bao' => 'CRM_Core_BAO_Job',
202 'scheduled_run_date' => [
203 'name' => 'scheduled_run_date',
204 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
205 'title' => ts('Scheduled Run Date'),
206 'description' => ts('When is this cron entry scheduled to run'),
208 'where' => 'civicrm_job.scheduled_run_date',
210 'table_name' => 'civicrm_job',
212 'bao' => 'CRM_Core_BAO_Job',
217 'type' => CRM_Utils_Type
::T_STRING
,
218 'title' => ts('Job Name'),
219 'description' => ts('Title of the job'),
221 'size' => CRM_Utils_Type
::HUGE
,
222 'where' => 'civicrm_job.name',
223 'table_name' => 'civicrm_job',
225 'bao' => 'CRM_Core_BAO_Job',
229 'name' => 'description',
230 'type' => CRM_Utils_Type
::T_STRING
,
231 'title' => ts('Job Description'),
232 'description' => ts('Description of the job'),
234 'size' => CRM_Utils_Type
::HUGE
,
235 'where' => 'civicrm_job.description',
236 'table_name' => 'civicrm_job',
238 'bao' => 'CRM_Core_BAO_Job',
242 'name' => 'api_entity',
243 'type' => CRM_Utils_Type
::T_STRING
,
244 'title' => ts('API Entity'),
245 'description' => ts('Entity of the job api call'),
247 'size' => CRM_Utils_Type
::HUGE
,
248 'where' => 'civicrm_job.api_entity',
249 'table_name' => 'civicrm_job',
251 'bao' => 'CRM_Core_BAO_Job',
255 'name' => 'api_action',
256 'type' => CRM_Utils_Type
::T_STRING
,
257 'title' => ts('API Action'),
258 'description' => ts('Action of the job api call'),
260 'size' => CRM_Utils_Type
::HUGE
,
261 'where' => 'civicrm_job.api_action',
262 'table_name' => 'civicrm_job',
264 'bao' => 'CRM_Core_BAO_Job',
268 'name' => 'parameters',
269 'type' => CRM_Utils_Type
::T_TEXT
,
270 'title' => ts('API Parameters'),
271 'description' => ts('List of parameters to the command.'),
274 'where' => 'civicrm_job.parameters',
275 'table_name' => 'civicrm_job',
277 'bao' => 'CRM_Core_BAO_Job',
280 'type' => 'TextArea',
284 'name' => 'is_active',
285 'type' => CRM_Utils_Type
::T_BOOLEAN
,
286 'title' => ts('Job Is Active?'),
287 'description' => ts('Is this job active?'),
288 'where' => 'civicrm_job.is_active',
289 'table_name' => 'civicrm_job',
291 'bao' => 'CRM_Core_BAO_Job',
295 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
297 return Civi
::$statics[__CLASS__
]['fields'];
301 * Return a mapping from field-name to the corresponding key (as used in fields()).
304 * Array(string $name => string $uniqueName).
306 public static function &fieldKeys() {
307 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
308 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
310 return Civi
::$statics[__CLASS__
]['fieldKeys'];
314 * Returns the names of this table
318 public static function getTableName() {
319 return self
::$_tableName;
323 * Returns if this table needs to be logged
327 public function getLog() {
332 * Returns the list of fields that can be imported
334 * @param bool $prefix
338 public static function &import($prefix = FALSE) {
339 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'job', $prefix, []);
344 * Returns the list of fields that can be exported
346 * @param bool $prefix
350 public static function &export($prefix = FALSE) {
351 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'job', $prefix, []);
356 * Returns the list of indices
358 * @param bool $localize
362 public static function indices($localize = TRUE) {
364 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;