5 * @copyright CiviCRM LLC (c) 2004-2017
7 * Generated from xml/schema/CRM/Core/Job.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:ec2775b0ba09eb61d32f1565ebbaf4f8)
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 static $_tableName = 'civicrm_job';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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' => 'Job Id',
145 'table_name' => 'civicrm_job',
147 'bao' => 'CRM_Core_BAO_Job',
151 'name' => 'domain_id',
152 'type' => CRM_Utils_Type
::T_INT
,
153 'title' => ts('Job Domain'),
154 'description' => 'Which Domain is this scheduled job for',
156 'table_name' => 'civicrm_job',
158 'bao' => 'CRM_Core_BAO_Job',
160 'FKClassName' => 'CRM_Core_DAO_Domain',
161 'pseudoconstant' => [
162 'table' => 'civicrm_domain',
164 'labelColumn' => 'name',
168 'name' => 'run_frequency',
169 'type' => CRM_Utils_Type
::T_STRING
,
170 'title' => ts('Job Frequency'),
171 'description' => 'Scheduled job run frequency.',
173 'size' => CRM_Utils_Type
::EIGHT
,
174 'default' => 'Daily',
175 'table_name' => 'civicrm_job',
177 'bao' => 'CRM_Core_BAO_Job',
182 'pseudoconstant' => [
183 'callback' => 'CRM_Core_SelectValues::getJobFrequency',
187 'name' => 'last_run',
188 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
189 'title' => ts('Last Run'),
190 'description' => 'When was this cron entry last run',
193 'table_name' => 'civicrm_job',
195 'bao' => 'CRM_Core_BAO_Job',
198 'scheduled_run_date' => [
199 'name' => 'scheduled_run_date',
200 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
201 'title' => ts('Scheduled Run Date'),
202 'description' => 'When is this cron entry scheduled to run',
205 'table_name' => 'civicrm_job',
207 'bao' => 'CRM_Core_BAO_Job',
212 'type' => CRM_Utils_Type
::T_STRING
,
213 'title' => ts('Job Name'),
214 'description' => 'Title of the job',
216 'size' => CRM_Utils_Type
::HUGE
,
217 'table_name' => 'civicrm_job',
219 'bao' => 'CRM_Core_BAO_Job',
223 'name' => 'description',
224 'type' => CRM_Utils_Type
::T_STRING
,
225 'title' => ts('Job Description'),
226 'description' => 'Description of the job',
228 'size' => CRM_Utils_Type
::HUGE
,
229 'table_name' => 'civicrm_job',
231 'bao' => 'CRM_Core_BAO_Job',
235 'name' => 'api_entity',
236 'type' => CRM_Utils_Type
::T_STRING
,
237 'title' => ts('API Entity'),
238 'description' => 'Entity of the job api call',
240 'size' => CRM_Utils_Type
::HUGE
,
241 'table_name' => 'civicrm_job',
243 'bao' => 'CRM_Core_BAO_Job',
247 'name' => 'api_action',
248 'type' => CRM_Utils_Type
::T_STRING
,
249 'title' => ts('API Action'),
250 'description' => 'Action of the job api call',
252 'size' => CRM_Utils_Type
::HUGE
,
253 'table_name' => 'civicrm_job',
255 'bao' => 'CRM_Core_BAO_Job',
259 'name' => 'parameters',
260 'type' => CRM_Utils_Type
::T_TEXT
,
261 'title' => ts('API Parameters'),
262 'description' => 'List of parameters to the command.',
265 'table_name' => 'civicrm_job',
267 'bao' => 'CRM_Core_BAO_Job',
270 'type' => 'TextArea',
274 'name' => 'is_active',
275 'type' => CRM_Utils_Type
::T_BOOLEAN
,
276 'title' => ts('Job Is Active?'),
277 'description' => 'Is this job active?',
278 'table_name' => 'civicrm_job',
280 'bao' => 'CRM_Core_BAO_Job',
284 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
286 return Civi
::$statics[__CLASS__
]['fields'];
290 * Return a mapping from field-name to the corresponding key (as used in fields()).
293 * Array(string $name => string $uniqueName).
295 public static function &fieldKeys() {
296 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
297 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
299 return Civi
::$statics[__CLASS__
]['fieldKeys'];
303 * Returns the names of this table
307 public static function getTableName() {
308 return self
::$_tableName;
312 * Returns if this table needs to be logged
316 public function getLog() {
321 * Returns the list of fields that can be imported
323 * @param bool $prefix
327 public static function &import($prefix = FALSE) {
328 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'job', $prefix, []);
333 * Returns the list of fields that can be exported
335 * @param bool $prefix
339 public static function &export($prefix = FALSE) {
340 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'job', $prefix, []);
345 * Returns the list of indices
347 * @param bool $localize
351 public static function indices($localize = TRUE) {
353 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;