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:6677b28207cbf86835164b7b33c38608)
13 * Database access object for the JobLog entity.
15 class CRM_Core_DAO_JobLog
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '4.1';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_job_log';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
41 * Which Domain is this scheduled job for
55 * Pointer to job id - not a FK though, just for logging purposes
69 * Full path to file containing job script
76 * Title line of log entry
83 * Potential extended data for specific job run (e.g. tracebacks).
92 public function __construct() {
93 $this->__table
= 'civicrm_job_log';
94 parent
::__construct();
98 * Returns localized title of this entity.
100 * @param bool $plural
101 * Whether to return the plural version of the title.
103 public static function getEntityTitle($plural = FALSE) {
104 return $plural ?
ts('Job Logs') : ts('Job Log');
108 * Returns foreign keys and entity references.
111 * [CRM_Core_Reference_Interface]
113 public static function getReferenceColumns() {
114 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
115 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
116 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
117 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
119 return Civi
::$statics[__CLASS__
]['links'];
123 * Returns all the column names of this table
127 public static function &fields() {
128 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
129 Civi
::$statics[__CLASS__
]['fields'] = [
132 'type' => CRM_Utils_Type
::T_INT
,
133 'title' => ts('Job Log ID'),
134 'description' => ts('Job log entry ID'),
136 'where' => 'civicrm_job_log.id',
137 'table_name' => 'civicrm_job_log',
138 'entity' => 'JobLog',
139 'bao' => 'CRM_Core_DAO_JobLog',
148 'name' => 'domain_id',
149 'type' => CRM_Utils_Type
::T_INT
,
150 'title' => ts('Domain ID'),
151 'description' => ts('Which Domain is this scheduled job for'),
153 'where' => 'civicrm_job_log.domain_id',
154 'table_name' => 'civicrm_job_log',
155 'entity' => 'JobLog',
156 'bao' => 'CRM_Core_DAO_JobLog',
158 'FKClassName' => 'CRM_Core_DAO_Domain',
160 'label' => ts("Domain"),
162 'pseudoconstant' => [
163 'table' => 'civicrm_domain',
165 'labelColumn' => 'name',
170 'name' => 'run_time',
171 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
172 'title' => ts('Timestamp'),
173 'description' => ts('Log entry date'),
174 'where' => 'civicrm_job_log.run_time',
175 'table_name' => 'civicrm_job_log',
176 'entity' => 'JobLog',
177 'bao' => 'CRM_Core_DAO_JobLog',
183 'type' => CRM_Utils_Type
::T_INT
,
184 'title' => ts('Job ID'),
185 'description' => ts('Pointer to job id - not a FK though, just for logging purposes'),
186 'where' => 'civicrm_job_log.job_id',
187 'table_name' => 'civicrm_job_log',
188 'entity' => 'JobLog',
189 'bao' => 'CRM_Core_DAO_JobLog',
195 'type' => CRM_Utils_Type
::T_STRING
,
196 'title' => ts('Job Name'),
197 'description' => ts('Title of the job'),
199 'size' => CRM_Utils_Type
::HUGE
,
200 'where' => 'civicrm_job_log.name',
201 'table_name' => 'civicrm_job_log',
202 'entity' => 'JobLog',
203 'bao' => 'CRM_Core_DAO_JobLog',
209 'type' => CRM_Utils_Type
::T_STRING
,
210 'title' => ts('Command'),
211 'description' => ts('Full path to file containing job script'),
213 'size' => CRM_Utils_Type
::HUGE
,
214 'where' => 'civicrm_job_log.command',
215 'table_name' => 'civicrm_job_log',
216 'entity' => 'JobLog',
217 'bao' => 'CRM_Core_DAO_JobLog',
222 'name' => 'description',
223 'type' => CRM_Utils_Type
::T_STRING
,
224 'title' => ts('Description'),
225 'description' => ts('Title line of log entry'),
227 'size' => CRM_Utils_Type
::HUGE
,
228 'where' => 'civicrm_job_log.description',
229 'table_name' => 'civicrm_job_log',
230 'entity' => 'JobLog',
231 'bao' => 'CRM_Core_DAO_JobLog',
237 'type' => CRM_Utils_Type
::T_TEXT
,
238 'title' => ts('Extended Data'),
239 'description' => ts('Potential extended data for specific job run (e.g. tracebacks).'),
240 'where' => 'civicrm_job_log.data',
241 'table_name' => 'civicrm_job_log',
242 'entity' => 'JobLog',
243 'bao' => 'CRM_Core_DAO_JobLog',
248 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
250 return Civi
::$statics[__CLASS__
]['fields'];
254 * Return a mapping from field-name to the corresponding key (as used in fields()).
257 * Array(string $name => string $uniqueName).
259 public static function &fieldKeys() {
260 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
261 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
263 return Civi
::$statics[__CLASS__
]['fieldKeys'];
267 * Returns the names of this table
271 public static function getTableName() {
272 return self
::$_tableName;
276 * Returns if this table needs to be logged
280 public function getLog() {
285 * Returns the list of fields that can be imported
287 * @param bool $prefix
291 public static function &import($prefix = FALSE) {
292 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'job_log', $prefix, []);
297 * Returns the list of fields that can be exported
299 * @param bool $prefix
303 public static function &export($prefix = FALSE) {
304 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'job_log', $prefix, []);
309 * Returns the list of indices
311 * @param bool $localize
315 public static function indices($localize = TRUE) {
317 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;