3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
31 * Generated from xml/schema/CRM/Core/Job.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:5c0e5cb30a7aaee5be8f3a2e6d23b84b)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_Job
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_job';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the FK relationships
55 static $_links = null;
57 * static value to see if we should log any modifications to
58 * this table in the civicrm_log table
70 * Which Domain is this scheduled job for
76 * Scheduled job run frequency.
80 public $run_frequency;
82 * When was this cron entry last run
88 * When is this cron entry scheduled to run
92 public $scheduled_run_date;
100 * Description of the job
106 * Entity of the job api call
112 * Action of the job api call
118 * List of parameters to the command.
124 * Is this job active?
132 * @return civicrm_job
134 function __construct() {
135 $this->__table
= 'civicrm_job';
136 parent
::__construct();
139 * Returns foreign keys and entity references
142 * [CRM_Core_Reference_Interface]
144 static function getReferenceColumns() {
145 if (!self
::$_links) {
146 self
::$_links = static ::createReferenceColumns(__CLASS__
);
147 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'domain_id', 'civicrm_domain', 'id');
149 return self
::$_links;
152 * Returns all the column names of this table
156 static function &fields() {
157 if (!(self
::$_fields)) {
158 self
::$_fields = array(
161 'type' => CRM_Utils_Type
::T_INT
,
162 'title' => ts('Job ID') ,
163 'description' => 'Job Id',
166 'domain_id' => array(
167 'name' => 'domain_id',
168 'type' => CRM_Utils_Type
::T_INT
,
169 'title' => ts('Job Domain') ,
170 'description' => 'Which Domain is this scheduled job for',
172 'FKClassName' => 'CRM_Core_DAO_Domain',
173 'pseudoconstant' => array(
174 'table' => 'civicrm_domain',
176 'labelColumn' => 'name',
179 'run_frequency' => array(
180 'name' => 'run_frequency',
181 'type' => CRM_Utils_Type
::T_STRING
,
182 'title' => ts('Job Frequency') ,
183 'description' => 'Scheduled job run frequency.',
185 'size' => CRM_Utils_Type
::EIGHT
,
186 'default' => 'Daily',
190 'pseudoconstant' => array(
191 'callback' => 'CRM_Core_SelectValues::getJobFrequency',
195 'name' => 'last_run',
196 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
197 'title' => ts('Last Run') ,
198 'description' => 'When was this cron entry last run',
201 'scheduled_run_date' => array(
202 'name' => 'scheduled_run_date',
203 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
204 'title' => ts('Scheduled Run Date') ,
205 'description' => 'When is this cron entry scheduled to run',
211 'type' => CRM_Utils_Type
::T_STRING
,
212 'title' => ts('Job Name') ,
213 'description' => 'Title of the job',
215 'size' => CRM_Utils_Type
::HUGE
,
217 'description' => array(
218 'name' => 'description',
219 'type' => CRM_Utils_Type
::T_STRING
,
220 'title' => ts('Job Description') ,
221 'description' => 'Description of the job',
223 'size' => CRM_Utils_Type
::HUGE
,
225 'api_entity' => array(
226 'name' => 'api_entity',
227 'type' => CRM_Utils_Type
::T_STRING
,
228 'title' => ts('API Entity') ,
229 'description' => 'Entity of the job api call',
231 'size' => CRM_Utils_Type
::HUGE
,
233 'api_action' => array(
234 'name' => 'api_action',
235 'type' => CRM_Utils_Type
::T_STRING
,
236 'title' => ts('API Action') ,
237 'description' => 'Action of the job api call',
239 'size' => CRM_Utils_Type
::HUGE
,
241 'parameters' => array(
242 'name' => 'parameters',
243 'type' => CRM_Utils_Type
::T_TEXT
,
244 'title' => ts('API Parameters') ,
245 'description' => 'List of parameters to the command.',
249 'type' => 'TextArea',
252 'is_active' => array(
253 'name' => 'is_active',
254 'type' => CRM_Utils_Type
::T_BOOLEAN
,
255 'title' => ts('Job Is Active?') ,
256 'description' => 'Is this job active?',
260 return self
::$_fields;
263 * Return a mapping from field-name to the corresponding key (as used in fields()).
266 * Array(string $name => string $uniqueName).
268 static function &fieldKeys() {
269 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
270 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
272 return Civi
::$statics[__CLASS__
]['fieldKeys'];
275 * Returns the names of this table
279 static function getTableName() {
280 return self
::$_tableName;
283 * Returns if this table needs to be logged
291 * Returns the list of fields that can be imported
293 * @param bool $prefix
297 static function &import($prefix = false) {
298 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'job', $prefix, array());
302 * Returns the list of fields that can be exported
304 * @param bool $prefix
308 static function &export($prefix = false) {
309 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'job', $prefix, array());