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:10c668f93f466aa0d49d258b6bc7badd)
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;
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
43 * Which Domain is this scheduled job for
46 * (SQL type: int unsigned)
47 * Note that values will be retrieved from the database as a string.
55 * (SQL type: timestamp)
56 * Note that values will be retrieved from the database as a string.
61 * Pointer to job id - not a FK though, just for logging purposes
63 * @var int|string|null
64 * (SQL type: int unsigned)
65 * Note that values will be retrieved from the database as a string.
73 * (SQL type: varchar(255))
74 * Note that values will be retrieved from the database as a string.
79 * Full path to file containing job script
82 * (SQL type: varchar(255))
83 * Note that values will be retrieved from the database as a string.
88 * Title line of log entry
91 * (SQL type: varchar(255))
92 * Note that values will be retrieved from the database as a string.
97 * Potential extended data for specific job run (e.g. tracebacks).
101 * Note that values will be retrieved from the database as a string.
108 public function __construct() {
109 $this->__table
= 'civicrm_job_log';
110 parent
::__construct();
114 * Returns localized title of this entity.
116 * @param bool $plural
117 * Whether to return the plural version of the title.
119 public static function getEntityTitle($plural = FALSE) {
120 return $plural ?
ts('Job Logs') : ts('Job Log');
124 * Returns foreign keys and entity references.
127 * [CRM_Core_Reference_Interface]
129 public static function getReferenceColumns() {
130 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
131 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
132 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
133 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
135 return Civi
::$statics[__CLASS__
]['links'];
139 * Returns all the column names of this table
143 public static function &fields() {
144 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
145 Civi
::$statics[__CLASS__
]['fields'] = [
148 'type' => CRM_Utils_Type
::T_INT
,
149 'title' => ts('Job Log ID'),
150 'description' => ts('Job log entry ID'),
152 'where' => 'civicrm_job_log.id',
153 'table_name' => 'civicrm_job_log',
154 'entity' => 'JobLog',
155 'bao' => 'CRM_Core_DAO_JobLog',
164 'name' => 'domain_id',
165 'type' => CRM_Utils_Type
::T_INT
,
166 'title' => ts('Domain ID'),
167 'description' => ts('Which Domain is this scheduled job for'),
169 'where' => 'civicrm_job_log.domain_id',
170 'table_name' => 'civicrm_job_log',
171 'entity' => 'JobLog',
172 'bao' => 'CRM_Core_DAO_JobLog',
174 'FKClassName' => 'CRM_Core_DAO_Domain',
176 'label' => ts("Domain"),
178 'pseudoconstant' => [
179 'table' => 'civicrm_domain',
181 'labelColumn' => 'name',
186 'name' => 'run_time',
187 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
188 'title' => ts('Timestamp'),
189 'description' => ts('Log entry date'),
190 'where' => 'civicrm_job_log.run_time',
191 'table_name' => 'civicrm_job_log',
192 'entity' => 'JobLog',
193 'bao' => 'CRM_Core_DAO_JobLog',
199 'type' => CRM_Utils_Type
::T_INT
,
200 'title' => ts('Job ID'),
201 'description' => ts('Pointer to job id - not a FK though, just for logging purposes'),
202 'where' => 'civicrm_job_log.job_id',
203 'table_name' => 'civicrm_job_log',
204 'entity' => 'JobLog',
205 'bao' => 'CRM_Core_DAO_JobLog',
211 'type' => CRM_Utils_Type
::T_STRING
,
212 'title' => ts('Job Name'),
213 'description' => ts('Title of the job'),
215 'size' => CRM_Utils_Type
::HUGE
,
216 'where' => 'civicrm_job_log.name',
217 'table_name' => 'civicrm_job_log',
218 'entity' => 'JobLog',
219 'bao' => 'CRM_Core_DAO_JobLog',
225 'type' => CRM_Utils_Type
::T_STRING
,
226 'title' => ts('Command'),
227 'description' => ts('Full path to file containing job script'),
229 'size' => CRM_Utils_Type
::HUGE
,
230 'where' => 'civicrm_job_log.command',
231 'table_name' => 'civicrm_job_log',
232 'entity' => 'JobLog',
233 'bao' => 'CRM_Core_DAO_JobLog',
238 'name' => 'description',
239 'type' => CRM_Utils_Type
::T_STRING
,
240 'title' => ts('Description'),
241 'description' => ts('Title line of log entry'),
243 'size' => CRM_Utils_Type
::HUGE
,
244 'where' => 'civicrm_job_log.description',
245 'table_name' => 'civicrm_job_log',
246 'entity' => 'JobLog',
247 'bao' => 'CRM_Core_DAO_JobLog',
253 'type' => CRM_Utils_Type
::T_TEXT
,
254 'title' => ts('Extended Data'),
255 'description' => ts('Potential extended data for specific job run (e.g. tracebacks).'),
256 'where' => 'civicrm_job_log.data',
257 'table_name' => 'civicrm_job_log',
258 'entity' => 'JobLog',
259 'bao' => 'CRM_Core_DAO_JobLog',
264 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
266 return Civi
::$statics[__CLASS__
]['fields'];
270 * Return a mapping from field-name to the corresponding key (as used in fields()).
273 * Array(string $name => string $uniqueName).
275 public static function &fieldKeys() {
276 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
277 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
279 return Civi
::$statics[__CLASS__
]['fieldKeys'];
283 * Returns the names of this table
287 public static function getTableName() {
288 return self
::$_tableName;
292 * Returns if this table needs to be logged
296 public function getLog() {
301 * Returns the list of fields that can be imported
303 * @param bool $prefix
307 public static function &import($prefix = FALSE) {
308 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'job_log', $prefix, []);
313 * Returns the list of fields that can be exported
315 * @param bool $prefix
319 public static function &export($prefix = FALSE) {
320 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'job_log', $prefix, []);
325 * Returns the list of indices
327 * @param bool $localize
331 public static function indices($localize = TRUE) {
333 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;