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:12719e12e89bcb64ad0f701988fe439b)
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 localized title of this entity.
98 public static function getEntityTitle() {
99 return ts('Job Logs');
103 * Returns foreign keys and entity references.
106 * [CRM_Core_Reference_Interface]
108 public static function getReferenceColumns() {
109 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
110 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
111 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
112 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
114 return Civi
::$statics[__CLASS__
]['links'];
118 * Returns all the column names of this table
122 public static function &fields() {
123 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
124 Civi
::$statics[__CLASS__
]['fields'] = [
127 'type' => CRM_Utils_Type
::T_INT
,
128 'title' => ts('Job Log ID'),
129 'description' => ts('Job log entry Id'),
131 'where' => 'civicrm_job_log.id',
132 'table_name' => 'civicrm_job_log',
133 'entity' => 'JobLog',
134 'bao' => 'CRM_Core_DAO_JobLog',
138 'name' => 'domain_id',
139 'type' => CRM_Utils_Type
::T_INT
,
140 'title' => ts('Domain ID'),
141 'description' => ts('Which Domain is this scheduled job for'),
143 'where' => 'civicrm_job_log.domain_id',
144 'table_name' => 'civicrm_job_log',
145 'entity' => 'JobLog',
146 'bao' => 'CRM_Core_DAO_JobLog',
148 'FKClassName' => 'CRM_Core_DAO_Domain',
149 'pseudoconstant' => [
150 'table' => 'civicrm_domain',
152 'labelColumn' => 'name',
156 'name' => 'run_time',
157 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
158 'title' => ts('Timestamp'),
159 'description' => ts('Log entry date'),
160 'where' => 'civicrm_job_log.run_time',
161 'table_name' => 'civicrm_job_log',
162 'entity' => 'JobLog',
163 'bao' => 'CRM_Core_DAO_JobLog',
168 'type' => CRM_Utils_Type
::T_INT
,
169 'title' => ts('Job ID'),
170 'description' => ts('Pointer to job id - not a FK though, just for logging purposes'),
171 'where' => 'civicrm_job_log.job_id',
172 'table_name' => 'civicrm_job_log',
173 'entity' => 'JobLog',
174 'bao' => 'CRM_Core_DAO_JobLog',
179 'type' => CRM_Utils_Type
::T_STRING
,
180 'title' => ts('Job Name'),
181 'description' => ts('Title of the job'),
183 'size' => CRM_Utils_Type
::HUGE
,
184 'where' => 'civicrm_job_log.name',
185 'table_name' => 'civicrm_job_log',
186 'entity' => 'JobLog',
187 'bao' => 'CRM_Core_DAO_JobLog',
192 'type' => CRM_Utils_Type
::T_STRING
,
193 'title' => ts('Command'),
194 'description' => ts('Full path to file containing job script'),
196 'size' => CRM_Utils_Type
::HUGE
,
197 'where' => 'civicrm_job_log.command',
198 'table_name' => 'civicrm_job_log',
199 'entity' => 'JobLog',
200 'bao' => 'CRM_Core_DAO_JobLog',
204 'name' => 'description',
205 'type' => CRM_Utils_Type
::T_STRING
,
206 'title' => ts('Description'),
207 'description' => ts('Title line of log entry'),
209 'size' => CRM_Utils_Type
::HUGE
,
210 'where' => 'civicrm_job_log.description',
211 'table_name' => 'civicrm_job_log',
212 'entity' => 'JobLog',
213 'bao' => 'CRM_Core_DAO_JobLog',
218 'type' => CRM_Utils_Type
::T_TEXT
,
219 'title' => ts('Extended Data'),
220 'description' => ts('Potential extended data for specific job run (e.g. tracebacks).'),
221 'where' => 'civicrm_job_log.data',
222 'table_name' => 'civicrm_job_log',
223 'entity' => 'JobLog',
224 'bao' => 'CRM_Core_DAO_JobLog',
228 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
230 return Civi
::$statics[__CLASS__
]['fields'];
234 * Return a mapping from field-name to the corresponding key (as used in fields()).
237 * Array(string $name => string $uniqueName).
239 public static function &fieldKeys() {
240 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
241 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
243 return Civi
::$statics[__CLASS__
]['fieldKeys'];
247 * Returns the names of this table
251 public static function getTableName() {
252 return self
::$_tableName;
256 * Returns if this table needs to be logged
260 public function getLog() {
265 * Returns the list of fields that can be imported
267 * @param bool $prefix
271 public static function &import($prefix = FALSE) {
272 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'job_log', $prefix, []);
277 * Returns the list of fields that can be exported
279 * @param bool $prefix
283 public static function &export($prefix = FALSE) {
284 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'job_log', $prefix, []);
289 * Returns the list of indices
291 * @param bool $localize
295 public static function indices($localize = TRUE) {
297 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;