5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/JobLog.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:3456b559213c3916aad90a0db8789757)
13 * Database access object for the JobLog entity.
15 class CRM_Core_DAO_JobLog
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_job_log';
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
53 * Pointer to job id - not a FK though, just for logging purposes
67 * Full path to file containing job script
74 * Title line of log entry
81 * Potential extended data for specific job run (e.g. tracebacks).
90 public function __construct() {
91 $this->__table
= 'civicrm_job_log';
92 parent
::__construct();
96 * Returns foreign keys and entity references.
99 * [CRM_Core_Reference_Interface]
101 public static function getReferenceColumns() {
102 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
103 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
104 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
105 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
107 return Civi
::$statics[__CLASS__
]['links'];
111 * Returns all the column names of this table
115 public static function &fields() {
116 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
117 Civi
::$statics[__CLASS__
]['fields'] = [
120 'type' => CRM_Utils_Type
::T_INT
,
121 'title' => ts('Job Log ID'),
122 'description' => ts('Job log entry Id'),
124 'where' => 'civicrm_job_log.id',
125 'table_name' => 'civicrm_job_log',
126 'entity' => 'JobLog',
127 'bao' => 'CRM_Core_DAO_JobLog',
131 'name' => 'domain_id',
132 'type' => CRM_Utils_Type
::T_INT
,
133 'title' => ts('Domain ID'),
134 'description' => ts('Which Domain is this scheduled job for'),
136 'where' => 'civicrm_job_log.domain_id',
137 'table_name' => 'civicrm_job_log',
138 'entity' => 'JobLog',
139 'bao' => 'CRM_Core_DAO_JobLog',
141 'FKClassName' => 'CRM_Core_DAO_Domain',
142 'pseudoconstant' => [
143 'table' => 'civicrm_domain',
145 'labelColumn' => 'name',
149 'name' => 'run_time',
150 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
151 'title' => ts('Timestamp'),
152 'description' => ts('Log entry date'),
153 'where' => 'civicrm_job_log.run_time',
154 'table_name' => 'civicrm_job_log',
155 'entity' => 'JobLog',
156 'bao' => 'CRM_Core_DAO_JobLog',
161 'type' => CRM_Utils_Type
::T_INT
,
162 'title' => ts('Job ID'),
163 'description' => ts('Pointer to job id - not a FK though, just for logging purposes'),
164 'where' => 'civicrm_job_log.job_id',
165 'table_name' => 'civicrm_job_log',
166 'entity' => 'JobLog',
167 'bao' => 'CRM_Core_DAO_JobLog',
172 'type' => CRM_Utils_Type
::T_STRING
,
173 'title' => ts('Job Name'),
174 'description' => ts('Title of the job'),
176 'size' => CRM_Utils_Type
::HUGE
,
177 'where' => 'civicrm_job_log.name',
178 'table_name' => 'civicrm_job_log',
179 'entity' => 'JobLog',
180 'bao' => 'CRM_Core_DAO_JobLog',
185 'type' => CRM_Utils_Type
::T_STRING
,
186 'title' => ts('Command'),
187 'description' => ts('Full path to file containing job script'),
189 'size' => CRM_Utils_Type
::HUGE
,
190 'where' => 'civicrm_job_log.command',
191 'table_name' => 'civicrm_job_log',
192 'entity' => 'JobLog',
193 'bao' => 'CRM_Core_DAO_JobLog',
197 'name' => 'description',
198 'type' => CRM_Utils_Type
::T_STRING
,
199 'title' => ts('Description'),
200 'description' => ts('Title line of log entry'),
202 'size' => CRM_Utils_Type
::HUGE
,
203 'where' => 'civicrm_job_log.description',
204 'table_name' => 'civicrm_job_log',
205 'entity' => 'JobLog',
206 'bao' => 'CRM_Core_DAO_JobLog',
211 'type' => CRM_Utils_Type
::T_TEXT
,
212 'title' => ts('Extended Data'),
213 'description' => ts('Potential extended data for specific job run (e.g. tracebacks).'),
214 'where' => 'civicrm_job_log.data',
215 'table_name' => 'civicrm_job_log',
216 'entity' => 'JobLog',
217 'bao' => 'CRM_Core_DAO_JobLog',
221 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
223 return Civi
::$statics[__CLASS__
]['fields'];
227 * Return a mapping from field-name to the corresponding key (as used in fields()).
230 * Array(string $name => string $uniqueName).
232 public static function &fieldKeys() {
233 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
234 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
236 return Civi
::$statics[__CLASS__
]['fieldKeys'];
240 * Returns the names of this table
244 public static function getTableName() {
245 return self
::$_tableName;
249 * Returns if this table needs to be logged
253 public function getLog() {
258 * Returns the list of fields that can be imported
260 * @param bool $prefix
264 public static function &import($prefix = FALSE) {
265 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'job_log', $prefix, []);
270 * Returns the list of fields that can be exported
272 * @param bool $prefix
276 public static function &export($prefix = FALSE) {
277 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'job_log', $prefix, []);
282 * Returns the list of indices
284 * @param bool $localize
288 public static function indices($localize = TRUE) {
290 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;