3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Core/Job.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:ec2775b0ba09eb61d32f1565ebbaf4f8)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Core_DAO_Job constructor.
40 class CRM_Core_DAO_Job
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_job';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Which Domain is this scheduled job for
66 * Scheduled job run frequency.
70 public $run_frequency;
72 * When was this cron entry last run
78 * When is this cron entry scheduled to run
82 public $scheduled_run_date;
90 * Description of the job
96 * Entity of the job api call
102 * Action of the job api call
108 * List of parameters to the command.
114 * Is this job active?
122 function __construct() {
123 $this->__table
= 'civicrm_job';
124 parent
::__construct();
127 * Returns foreign keys and entity references.
130 * [CRM_Core_Reference_Interface]
132 static function getReferenceColumns() {
133 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
134 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
135 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'domain_id', 'civicrm_domain', 'id');
136 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
138 return Civi
::$statics[__CLASS__
]['links'];
141 * Returns all the column names of this table
145 static function &fields() {
146 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
147 Civi
::$statics[__CLASS__
]['fields'] = array(
150 'type' => CRM_Utils_Type
::T_INT
,
151 'title' => ts('Job ID') ,
152 'description' => 'Job Id',
154 'table_name' => 'civicrm_job',
156 'bao' => 'CRM_Core_BAO_Job',
159 'domain_id' => array(
160 'name' => 'domain_id',
161 'type' => CRM_Utils_Type
::T_INT
,
162 'title' => ts('Job Domain') ,
163 'description' => 'Which Domain is this scheduled job for',
165 'table_name' => 'civicrm_job',
167 'bao' => 'CRM_Core_BAO_Job',
169 'FKClassName' => 'CRM_Core_DAO_Domain',
170 'pseudoconstant' => array(
171 'table' => 'civicrm_domain',
173 'labelColumn' => 'name',
176 'run_frequency' => array(
177 'name' => 'run_frequency',
178 'type' => CRM_Utils_Type
::T_STRING
,
179 'title' => ts('Job Frequency') ,
180 'description' => 'Scheduled job run frequency.',
182 'size' => CRM_Utils_Type
::EIGHT
,
183 'default' => 'Daily',
184 'table_name' => 'civicrm_job',
186 'bao' => 'CRM_Core_BAO_Job',
191 'pseudoconstant' => array(
192 'callback' => 'CRM_Core_SelectValues::getJobFrequency',
196 'name' => 'last_run',
197 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
198 'title' => ts('Last Run') ,
199 'description' => 'When was this cron entry last run',
202 'table_name' => 'civicrm_job',
204 'bao' => 'CRM_Core_BAO_Job',
207 'scheduled_run_date' => array(
208 'name' => 'scheduled_run_date',
209 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
210 'title' => ts('Scheduled Run Date') ,
211 'description' => 'When is this cron entry scheduled to run',
214 'table_name' => 'civicrm_job',
216 'bao' => 'CRM_Core_BAO_Job',
221 'type' => CRM_Utils_Type
::T_STRING
,
222 'title' => ts('Job Name') ,
223 'description' => 'Title of the job',
225 'size' => CRM_Utils_Type
::HUGE
,
226 'table_name' => 'civicrm_job',
228 'bao' => 'CRM_Core_BAO_Job',
231 'description' => array(
232 'name' => 'description',
233 'type' => CRM_Utils_Type
::T_STRING
,
234 'title' => ts('Job Description') ,
235 'description' => 'Description of the job',
237 'size' => CRM_Utils_Type
::HUGE
,
238 'table_name' => 'civicrm_job',
240 'bao' => 'CRM_Core_BAO_Job',
243 'api_entity' => array(
244 'name' => 'api_entity',
245 'type' => CRM_Utils_Type
::T_STRING
,
246 'title' => ts('API Entity') ,
247 'description' => 'Entity of the job api call',
249 'size' => CRM_Utils_Type
::HUGE
,
250 'table_name' => 'civicrm_job',
252 'bao' => 'CRM_Core_BAO_Job',
255 'api_action' => array(
256 'name' => 'api_action',
257 'type' => CRM_Utils_Type
::T_STRING
,
258 'title' => ts('API Action') ,
259 'description' => 'Action of the job api call',
261 'size' => CRM_Utils_Type
::HUGE
,
262 'table_name' => 'civicrm_job',
264 'bao' => 'CRM_Core_BAO_Job',
267 'parameters' => array(
268 'name' => 'parameters',
269 'type' => CRM_Utils_Type
::T_TEXT
,
270 'title' => ts('API Parameters') ,
271 'description' => 'List of parameters to the command.',
274 'table_name' => 'civicrm_job',
276 'bao' => 'CRM_Core_BAO_Job',
279 'type' => 'TextArea',
282 'is_active' => array(
283 'name' => 'is_active',
284 'type' => CRM_Utils_Type
::T_BOOLEAN
,
285 'title' => ts('Job Is Active?') ,
286 'description' => 'Is this job active?',
287 'table_name' => 'civicrm_job',
289 'bao' => 'CRM_Core_BAO_Job',
293 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
295 return Civi
::$statics[__CLASS__
]['fields'];
298 * Return a mapping from field-name to the corresponding key (as used in fields()).
301 * Array(string $name => string $uniqueName).
303 static function &fieldKeys() {
304 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
305 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
307 return Civi
::$statics[__CLASS__
]['fieldKeys'];
310 * Returns the names of this table
314 static function getTableName() {
315 return self
::$_tableName;
318 * Returns if this table needs to be logged
326 * Returns the list of fields that can be imported
328 * @param bool $prefix
332 static function &import($prefix = false) {
333 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'job', $prefix, array());
337 * Returns the list of fields that can be exported
339 * @param bool $prefix
343 static function &export($prefix = false) {
344 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'job', $prefix, array());
348 * Returns the list of indices
350 public static function indices($localize = TRUE) {
352 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;