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:74e191eba977eb496bae109ca9720ab7)
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',
144 'name' => 'domain_id',
145 'type' => CRM_Utils_Type
::T_INT
,
146 'title' => ts('Domain ID'),
147 'description' => ts('Which Domain is this scheduled job for'),
149 'where' => 'civicrm_job_log.domain_id',
150 'table_name' => 'civicrm_job_log',
151 'entity' => 'JobLog',
152 'bao' => 'CRM_Core_DAO_JobLog',
154 'FKClassName' => 'CRM_Core_DAO_Domain',
155 'pseudoconstant' => [
156 'table' => 'civicrm_domain',
158 'labelColumn' => 'name',
163 'name' => 'run_time',
164 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
165 'title' => ts('Timestamp'),
166 'description' => ts('Log entry date'),
167 'where' => 'civicrm_job_log.run_time',
168 'table_name' => 'civicrm_job_log',
169 'entity' => 'JobLog',
170 'bao' => 'CRM_Core_DAO_JobLog',
176 'type' => CRM_Utils_Type
::T_INT
,
177 'title' => ts('Job ID'),
178 'description' => ts('Pointer to job id - not a FK though, just for logging purposes'),
179 'where' => 'civicrm_job_log.job_id',
180 'table_name' => 'civicrm_job_log',
181 'entity' => 'JobLog',
182 'bao' => 'CRM_Core_DAO_JobLog',
188 'type' => CRM_Utils_Type
::T_STRING
,
189 'title' => ts('Job Name'),
190 'description' => ts('Title of the job'),
192 'size' => CRM_Utils_Type
::HUGE
,
193 'where' => 'civicrm_job_log.name',
194 'table_name' => 'civicrm_job_log',
195 'entity' => 'JobLog',
196 'bao' => 'CRM_Core_DAO_JobLog',
202 'type' => CRM_Utils_Type
::T_STRING
,
203 'title' => ts('Command'),
204 'description' => ts('Full path to file containing job script'),
206 'size' => CRM_Utils_Type
::HUGE
,
207 'where' => 'civicrm_job_log.command',
208 'table_name' => 'civicrm_job_log',
209 'entity' => 'JobLog',
210 'bao' => 'CRM_Core_DAO_JobLog',
215 'name' => 'description',
216 'type' => CRM_Utils_Type
::T_STRING
,
217 'title' => ts('Description'),
218 'description' => ts('Title line of log entry'),
220 'size' => CRM_Utils_Type
::HUGE
,
221 'where' => 'civicrm_job_log.description',
222 'table_name' => 'civicrm_job_log',
223 'entity' => 'JobLog',
224 'bao' => 'CRM_Core_DAO_JobLog',
230 'type' => CRM_Utils_Type
::T_TEXT
,
231 'title' => ts('Extended Data'),
232 'description' => ts('Potential extended data for specific job run (e.g. tracebacks).'),
233 'where' => 'civicrm_job_log.data',
234 'table_name' => 'civicrm_job_log',
235 'entity' => 'JobLog',
236 'bao' => 'CRM_Core_DAO_JobLog',
241 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
243 return Civi
::$statics[__CLASS__
]['fields'];
247 * Return a mapping from field-name to the corresponding key (as used in fields()).
250 * Array(string $name => string $uniqueName).
252 public static function &fieldKeys() {
253 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
254 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
256 return Civi
::$statics[__CLASS__
]['fieldKeys'];
260 * Returns the names of this table
264 public static function getTableName() {
265 return self
::$_tableName;
269 * Returns if this table needs to be logged
273 public function getLog() {
278 * Returns the list of fields that can be imported
280 * @param bool $prefix
284 public static function &import($prefix = FALSE) {
285 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'job_log', $prefix, []);
290 * Returns the list of fields that can be exported
292 * @param bool $prefix
296 public static function &export($prefix = FALSE) {
297 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'job_log', $prefix, []);
302 * Returns the list of indices
304 * @param bool $localize
308 public static function indices($localize = TRUE) {
310 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;