5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/JobLog.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:68e8b90d050e64feef2b1868d83a7923)
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 static $_tableName = 'civicrm_job_log';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 'table_name' => 'civicrm_job_log',
125 'entity' => 'JobLog',
126 'bao' => 'CRM_Core_DAO_JobLog',
130 'name' => 'domain_id',
131 'type' => CRM_Utils_Type
::T_INT
,
132 'title' => ts('Domain ID'),
133 'description' => ts('Which Domain is this scheduled job for'),
135 'table_name' => 'civicrm_job_log',
136 'entity' => 'JobLog',
137 'bao' => 'CRM_Core_DAO_JobLog',
139 'FKClassName' => 'CRM_Core_DAO_Domain',
140 'pseudoconstant' => [
141 'table' => 'civicrm_domain',
143 'labelColumn' => 'name',
147 'name' => 'run_time',
148 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
149 'title' => ts('Timestamp'),
150 'description' => ts('Log entry date'),
151 'table_name' => 'civicrm_job_log',
152 'entity' => 'JobLog',
153 'bao' => 'CRM_Core_DAO_JobLog',
158 'type' => CRM_Utils_Type
::T_INT
,
159 'title' => ts('Job ID'),
160 'description' => ts('Pointer to job id - not a FK though, just for logging purposes'),
161 'table_name' => 'civicrm_job_log',
162 'entity' => 'JobLog',
163 'bao' => 'CRM_Core_DAO_JobLog',
168 'type' => CRM_Utils_Type
::T_STRING
,
169 'title' => ts('Job Name'),
170 'description' => ts('Title of the job'),
172 'size' => CRM_Utils_Type
::HUGE
,
173 'table_name' => 'civicrm_job_log',
174 'entity' => 'JobLog',
175 'bao' => 'CRM_Core_DAO_JobLog',
180 'type' => CRM_Utils_Type
::T_STRING
,
181 'title' => ts('Command'),
182 'description' => ts('Full path to file containing job script'),
184 'size' => CRM_Utils_Type
::HUGE
,
185 'table_name' => 'civicrm_job_log',
186 'entity' => 'JobLog',
187 'bao' => 'CRM_Core_DAO_JobLog',
191 'name' => 'description',
192 'type' => CRM_Utils_Type
::T_STRING
,
193 'title' => ts('Description'),
194 'description' => ts('Title line of log entry'),
196 'size' => CRM_Utils_Type
::HUGE
,
197 'table_name' => 'civicrm_job_log',
198 'entity' => 'JobLog',
199 'bao' => 'CRM_Core_DAO_JobLog',
204 'type' => CRM_Utils_Type
::T_TEXT
,
205 'title' => ts('Extended Data'),
206 'description' => ts('Potential extended data for specific job run (e.g. tracebacks).'),
207 'table_name' => 'civicrm_job_log',
208 'entity' => 'JobLog',
209 'bao' => 'CRM_Core_DAO_JobLog',
213 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
215 return Civi
::$statics[__CLASS__
]['fields'];
219 * Return a mapping from field-name to the corresponding key (as used in fields()).
222 * Array(string $name => string $uniqueName).
224 public static function &fieldKeys() {
225 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
226 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
228 return Civi
::$statics[__CLASS__
]['fieldKeys'];
232 * Returns the names of this table
236 public static function getTableName() {
237 return self
::$_tableName;
241 * Returns if this table needs to be logged
245 public function getLog() {
250 * Returns the list of fields that can be imported
252 * @param bool $prefix
256 public static function &import($prefix = FALSE) {
257 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'job_log', $prefix, []);
262 * Returns the list of fields that can be exported
264 * @param bool $prefix
268 public static function &export($prefix = FALSE) {
269 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'job_log', $prefix, []);
274 * Returns the list of indices
276 * @param bool $localize
280 public static function indices($localize = TRUE) {
282 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;