Add titles and icons to entities
[civicrm-core.git] / CRM / Core / DAO / JobLog.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Core/JobLog.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:12719e12e89bcb64ad0f701988fe439b)
10 */
11
12 /**
13 * Database access object for the JobLog entity.
14 */
15 class CRM_Core_DAO_JobLog extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_job_log';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 public static $_log = FALSE;
30
31 /**
32 * Job log entry Id
33 *
34 * @var int
35 */
36 public $id;
37
38 /**
39 * Which Domain is this scheduled job for
40 *
41 * @var int
42 */
43 public $domain_id;
44
45 /**
46 * Log entry date
47 *
48 * @var timestamp
49 */
50 public $run_time;
51
52 /**
53 * Pointer to job id - not a FK though, just for logging purposes
54 *
55 * @var int
56 */
57 public $job_id;
58
59 /**
60 * Title of the job
61 *
62 * @var string
63 */
64 public $name;
65
66 /**
67 * Full path to file containing job script
68 *
69 * @var string
70 */
71 public $command;
72
73 /**
74 * Title line of log entry
75 *
76 * @var string
77 */
78 public $description;
79
80 /**
81 * Potential extended data for specific job run (e.g. tracebacks).
82 *
83 * @var text
84 */
85 public $data;
86
87 /**
88 * Class constructor.
89 */
90 public function __construct() {
91 $this->__table = 'civicrm_job_log';
92 parent::__construct();
93 }
94
95 /**
96 * Returns localized title of this entity.
97 */
98 public static function getEntityTitle() {
99 return ts('Job Logs');
100 }
101
102 /**
103 * Returns foreign keys and entity references.
104 *
105 * @return array
106 * [CRM_Core_Reference_Interface]
107 */
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']);
113 }
114 return Civi::$statics[__CLASS__]['links'];
115 }
116
117 /**
118 * Returns all the column names of this table
119 *
120 * @return array
121 */
122 public static function &fields() {
123 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
124 Civi::$statics[__CLASS__]['fields'] = [
125 'id' => [
126 'name' => 'id',
127 'type' => CRM_Utils_Type::T_INT,
128 'title' => ts('Job Log ID'),
129 'description' => ts('Job log entry Id'),
130 'required' => TRUE,
131 'where' => 'civicrm_job_log.id',
132 'table_name' => 'civicrm_job_log',
133 'entity' => 'JobLog',
134 'bao' => 'CRM_Core_DAO_JobLog',
135 'localizable' => 0,
136 ],
137 'domain_id' => [
138 'name' => 'domain_id',
139 'type' => CRM_Utils_Type::T_INT,
140 'title' => ts('Domain ID'),
141 'description' => ts('Which Domain is this scheduled job for'),
142 'required' => TRUE,
143 'where' => 'civicrm_job_log.domain_id',
144 'table_name' => 'civicrm_job_log',
145 'entity' => 'JobLog',
146 'bao' => 'CRM_Core_DAO_JobLog',
147 'localizable' => 0,
148 'FKClassName' => 'CRM_Core_DAO_Domain',
149 'pseudoconstant' => [
150 'table' => 'civicrm_domain',
151 'keyColumn' => 'id',
152 'labelColumn' => 'name',
153 ],
154 ],
155 'run_time' => [
156 'name' => 'run_time',
157 'type' => CRM_Utils_Type::T_TIMESTAMP,
158 'title' => ts('Timestamp'),
159 'description' => ts('Log entry date'),
160 'where' => 'civicrm_job_log.run_time',
161 'table_name' => 'civicrm_job_log',
162 'entity' => 'JobLog',
163 'bao' => 'CRM_Core_DAO_JobLog',
164 'localizable' => 0,
165 ],
166 'job_id' => [
167 'name' => 'job_id',
168 'type' => CRM_Utils_Type::T_INT,
169 'title' => ts('Job ID'),
170 'description' => ts('Pointer to job id - not a FK though, just for logging purposes'),
171 'where' => 'civicrm_job_log.job_id',
172 'table_name' => 'civicrm_job_log',
173 'entity' => 'JobLog',
174 'bao' => 'CRM_Core_DAO_JobLog',
175 'localizable' => 0,
176 ],
177 'name' => [
178 'name' => 'name',
179 'type' => CRM_Utils_Type::T_STRING,
180 'title' => ts('Job Name'),
181 'description' => ts('Title of the job'),
182 'maxlength' => 255,
183 'size' => CRM_Utils_Type::HUGE,
184 'where' => 'civicrm_job_log.name',
185 'table_name' => 'civicrm_job_log',
186 'entity' => 'JobLog',
187 'bao' => 'CRM_Core_DAO_JobLog',
188 'localizable' => 0,
189 ],
190 'command' => [
191 'name' => 'command',
192 'type' => CRM_Utils_Type::T_STRING,
193 'title' => ts('Command'),
194 'description' => ts('Full path to file containing job script'),
195 'maxlength' => 255,
196 'size' => CRM_Utils_Type::HUGE,
197 'where' => 'civicrm_job_log.command',
198 'table_name' => 'civicrm_job_log',
199 'entity' => 'JobLog',
200 'bao' => 'CRM_Core_DAO_JobLog',
201 'localizable' => 0,
202 ],
203 'description' => [
204 'name' => 'description',
205 'type' => CRM_Utils_Type::T_STRING,
206 'title' => ts('Description'),
207 'description' => ts('Title line of log entry'),
208 'maxlength' => 255,
209 'size' => CRM_Utils_Type::HUGE,
210 'where' => 'civicrm_job_log.description',
211 'table_name' => 'civicrm_job_log',
212 'entity' => 'JobLog',
213 'bao' => 'CRM_Core_DAO_JobLog',
214 'localizable' => 0,
215 ],
216 'data' => [
217 'name' => 'data',
218 'type' => CRM_Utils_Type::T_TEXT,
219 'title' => ts('Extended Data'),
220 'description' => ts('Potential extended data for specific job run (e.g. tracebacks).'),
221 'where' => 'civicrm_job_log.data',
222 'table_name' => 'civicrm_job_log',
223 'entity' => 'JobLog',
224 'bao' => 'CRM_Core_DAO_JobLog',
225 'localizable' => 0,
226 ],
227 ];
228 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
229 }
230 return Civi::$statics[__CLASS__]['fields'];
231 }
232
233 /**
234 * Return a mapping from field-name to the corresponding key (as used in fields()).
235 *
236 * @return array
237 * Array(string $name => string $uniqueName).
238 */
239 public static function &fieldKeys() {
240 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
241 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
242 }
243 return Civi::$statics[__CLASS__]['fieldKeys'];
244 }
245
246 /**
247 * Returns the names of this table
248 *
249 * @return string
250 */
251 public static function getTableName() {
252 return self::$_tableName;
253 }
254
255 /**
256 * Returns if this table needs to be logged
257 *
258 * @return bool
259 */
260 public function getLog() {
261 return self::$_log;
262 }
263
264 /**
265 * Returns the list of fields that can be imported
266 *
267 * @param bool $prefix
268 *
269 * @return array
270 */
271 public static function &import($prefix = FALSE) {
272 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'job_log', $prefix, []);
273 return $r;
274 }
275
276 /**
277 * Returns the list of fields that can be exported
278 *
279 * @param bool $prefix
280 *
281 * @return array
282 */
283 public static function &export($prefix = FALSE) {
284 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'job_log', $prefix, []);
285 return $r;
286 }
287
288 /**
289 * Returns the list of indices
290 *
291 * @param bool $localize
292 *
293 * @return array
294 */
295 public static function indices($localize = TRUE) {
296 $indices = [];
297 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
298 }
299
300 }