3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Core/Log.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:a0c51596a4ccc5f07a5dcec00bbb7231)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Core_DAO_Log constructor.
40 class CRM_Core_DAO_Log
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_log';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Name of table where item being referenced is stored.
66 * Foreign key to the referenced item.
72 * Updates does to this object if any.
78 * FK to Contact ID of person under whose credentials this data modification was made.
84 * When was the referenced entity created or modified or deleted.
88 public $modified_date;
92 function __construct() {
93 $this->__table
= 'civicrm_log';
94 parent
::__construct();
97 * Returns foreign keys and entity references.
100 * [CRM_Core_Reference_Interface]
102 static function getReferenceColumns() {
103 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
104 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
105 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'modified_id', 'civicrm_contact', 'id');
106 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
107 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
109 return Civi
::$statics[__CLASS__
]['links'];
112 * Returns all the column names of this table
116 static function &fields() {
117 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
118 Civi
::$statics[__CLASS__
]['fields'] = array(
121 'type' => CRM_Utils_Type
::T_INT
,
122 'title' => ts('Log ID') ,
123 'description' => 'Log ID',
125 'table_name' => 'civicrm_log',
127 'bao' => 'CRM_Core_BAO_Log',
129 'entity_table' => array(
130 'name' => 'entity_table',
131 'type' => CRM_Utils_Type
::T_STRING
,
132 'title' => ts('Entity Table') ,
133 'description' => 'Name of table where item being referenced is stored.',
136 'size' => CRM_Utils_Type
::BIG
,
137 'table_name' => 'civicrm_log',
139 'bao' => 'CRM_Core_BAO_Log',
141 'entity_id' => array(
142 'name' => 'entity_id',
143 'type' => CRM_Utils_Type
::T_INT
,
144 'title' => ts('Entity ID ') ,
145 'description' => 'Foreign key to the referenced item.',
147 'table_name' => 'civicrm_log',
149 'bao' => 'CRM_Core_BAO_Log',
153 'type' => CRM_Utils_Type
::T_TEXT
,
154 'title' => ts('Data') ,
155 'description' => 'Updates does to this object if any.',
156 'table_name' => 'civicrm_log',
158 'bao' => 'CRM_Core_BAO_Log',
160 'modified_id' => array(
161 'name' => 'modified_id',
162 'type' => CRM_Utils_Type
::T_INT
,
163 'title' => ts('Modified By') ,
164 'description' => 'FK to Contact ID of person under whose credentials this data modification was made.',
165 'table_name' => 'civicrm_log',
167 'bao' => 'CRM_Core_BAO_Log',
168 'FKClassName' => 'CRM_Contact_DAO_Contact',
170 'modified_date' => array(
171 'name' => 'modified_date',
172 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
173 'title' => ts('Modified Date') ,
174 'description' => 'When was the referenced entity created or modified or deleted.',
175 'table_name' => 'civicrm_log',
177 'bao' => 'CRM_Core_BAO_Log',
180 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
182 return Civi
::$statics[__CLASS__
]['fields'];
185 * Return a mapping from field-name to the corresponding key (as used in fields()).
188 * Array(string $name => string $uniqueName).
190 static function &fieldKeys() {
191 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
192 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
194 return Civi
::$statics[__CLASS__
]['fieldKeys'];
197 * Returns the names of this table
201 static function getTableName() {
202 return self
::$_tableName;
205 * Returns if this table needs to be logged
213 * Returns the list of fields that can be imported
215 * @param bool $prefix
219 static function &import($prefix = false) {
220 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'log', $prefix, array());
224 * Returns the list of fields that can be exported
226 * @param bool $prefix
230 static function &export($prefix = false) {
231 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'log', $prefix, array());