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:d5266d899de027b3411970632fd2d6ef)
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',
139 'name' => 'domain_id',
140 'type' => CRM_Utils_Type
::T_INT
,
141 'title' => ts('Domain ID'),
142 'description' => ts('Which Domain is this scheduled job for'),
144 'where' => 'civicrm_job_log.domain_id',
145 'table_name' => 'civicrm_job_log',
146 'entity' => 'JobLog',
147 'bao' => 'CRM_Core_DAO_JobLog',
149 'FKClassName' => 'CRM_Core_DAO_Domain',
150 'pseudoconstant' => [
151 'table' => 'civicrm_domain',
153 'labelColumn' => 'name',
158 'name' => 'run_time',
159 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
160 'title' => ts('Timestamp'),
161 'description' => ts('Log entry date'),
162 'where' => 'civicrm_job_log.run_time',
163 'table_name' => 'civicrm_job_log',
164 'entity' => 'JobLog',
165 'bao' => 'CRM_Core_DAO_JobLog',
171 'type' => CRM_Utils_Type
::T_INT
,
172 'title' => ts('Job ID'),
173 'description' => ts('Pointer to job id - not a FK though, just for logging purposes'),
174 'where' => 'civicrm_job_log.job_id',
175 'table_name' => 'civicrm_job_log',
176 'entity' => 'JobLog',
177 'bao' => 'CRM_Core_DAO_JobLog',
183 'type' => CRM_Utils_Type
::T_STRING
,
184 'title' => ts('Job Name'),
185 'description' => ts('Title of the job'),
187 'size' => CRM_Utils_Type
::HUGE
,
188 'where' => 'civicrm_job_log.name',
189 'table_name' => 'civicrm_job_log',
190 'entity' => 'JobLog',
191 'bao' => 'CRM_Core_DAO_JobLog',
197 'type' => CRM_Utils_Type
::T_STRING
,
198 'title' => ts('Command'),
199 'description' => ts('Full path to file containing job script'),
201 'size' => CRM_Utils_Type
::HUGE
,
202 'where' => 'civicrm_job_log.command',
203 'table_name' => 'civicrm_job_log',
204 'entity' => 'JobLog',
205 'bao' => 'CRM_Core_DAO_JobLog',
210 'name' => 'description',
211 'type' => CRM_Utils_Type
::T_STRING
,
212 'title' => ts('Description'),
213 'description' => ts('Title line of log entry'),
215 'size' => CRM_Utils_Type
::HUGE
,
216 'where' => 'civicrm_job_log.description',
217 'table_name' => 'civicrm_job_log',
218 'entity' => 'JobLog',
219 'bao' => 'CRM_Core_DAO_JobLog',
225 'type' => CRM_Utils_Type
::T_TEXT
,
226 'title' => ts('Extended Data'),
227 'description' => ts('Potential extended data for specific job run (e.g. tracebacks).'),
228 'where' => 'civicrm_job_log.data',
229 'table_name' => 'civicrm_job_log',
230 'entity' => 'JobLog',
231 'bao' => 'CRM_Core_DAO_JobLog',
236 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
238 return Civi
::$statics[__CLASS__
]['fields'];
242 * Return a mapping from field-name to the corresponding key (as used in fields()).
245 * Array(string $name => string $uniqueName).
247 public static function &fieldKeys() {
248 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
249 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
251 return Civi
::$statics[__CLASS__
]['fieldKeys'];
255 * Returns the names of this table
259 public static function getTableName() {
260 return self
::$_tableName;
264 * Returns if this table needs to be logged
268 public function getLog() {
273 * Returns the list of fields that can be imported
275 * @param bool $prefix
279 public static function &import($prefix = FALSE) {
280 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'job_log', $prefix, []);
285 * Returns the list of fields that can be exported
287 * @param bool $prefix
291 public static function &export($prefix = FALSE) {
292 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'job_log', $prefix, []);
297 * Returns the list of indices
299 * @param bool $localize
303 public static function indices($localize = TRUE) {
305 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;