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/Note.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:ad394e9a106ae70fd38afdbe29030fae)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Core_DAO_Note constructor.
40 class CRM_Core_DAO_Note
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_note';
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 * Note and/or Comment.
78 * FK to Contact ID creator
84 * When was this note last modified/edited
88 public $modified_date;
90 * subject of note description
96 * Foreign Key to Note Privacy Level (which is an option value pair and hence an implicit FK)
104 function __construct() {
105 $this->__table
= 'civicrm_note';
106 parent
::__construct();
109 * Returns foreign keys and entity references.
112 * [CRM_Core_Reference_Interface]
114 static function getReferenceColumns() {
115 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
116 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
117 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
118 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
119 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
121 return Civi
::$statics[__CLASS__
]['links'];
124 * Returns all the column names of this table
128 static function &fields() {
129 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
130 Civi
::$statics[__CLASS__
]['fields'] = array(
133 'type' => CRM_Utils_Type
::T_INT
,
134 'title' => ts('Note ID') ,
135 'description' => 'Note ID',
137 'table_name' => 'civicrm_note',
139 'bao' => 'CRM_Core_BAO_Note',
141 'entity_table' => array(
142 'name' => 'entity_table',
143 'type' => CRM_Utils_Type
::T_STRING
,
144 'title' => ts('Note Entity') ,
145 'description' => 'Name of table where item being referenced is stored.',
148 'size' => CRM_Utils_Type
::BIG
,
149 'table_name' => 'civicrm_note',
151 'bao' => 'CRM_Core_BAO_Note',
152 'pseudoconstant' => array(
153 'callback' => 'CRM_Core_BAO_Note::entityTables',
156 'entity_id' => array(
157 'name' => 'entity_id',
158 'type' => CRM_Utils_Type
::T_INT
,
159 'title' => ts('Note Entity ID') ,
160 'description' => 'Foreign key to the referenced item.',
162 'table_name' => 'civicrm_note',
164 'bao' => 'CRM_Core_BAO_Note',
168 'type' => CRM_Utils_Type
::T_TEXT
,
169 'title' => ts('Note') ,
170 'description' => 'Note and/or Comment.',
174 'where' => 'civicrm_note.note',
175 'headerPattern' => '/Note|Comment/i',
176 'dataPattern' => '//',
178 'table_name' => 'civicrm_note',
180 'bao' => 'CRM_Core_BAO_Note',
182 'type' => 'TextArea',
185 'contact_id' => array(
186 'name' => 'contact_id',
187 'type' => CRM_Utils_Type
::T_INT
,
188 'title' => ts('Note Created By') ,
189 'description' => 'FK to Contact ID creator',
190 'table_name' => 'civicrm_note',
192 'bao' => 'CRM_Core_BAO_Note',
193 'FKClassName' => 'CRM_Contact_DAO_Contact',
195 'modified_date' => array(
196 'name' => 'modified_date',
197 'type' => CRM_Utils_Type
::T_DATE
,
198 'title' => ts('Note Modified By') ,
199 'description' => 'When was this note last modified/edited',
200 'table_name' => 'civicrm_note',
202 'bao' => 'CRM_Core_BAO_Note',
206 'type' => CRM_Utils_Type
::T_STRING
,
207 'title' => ts('Subject') ,
208 'description' => 'subject of note description',
211 'table_name' => 'civicrm_note',
213 'bao' => 'CRM_Core_BAO_Note',
220 'type' => CRM_Utils_Type
::T_STRING
,
221 'title' => ts('Privacy') ,
222 'description' => 'Foreign Key to Note Privacy Level (which is an option value pair and hence an implicit FK)',
224 'size' => CRM_Utils_Type
::HUGE
,
225 'table_name' => 'civicrm_note',
227 'bao' => 'CRM_Core_BAO_Note',
228 'pseudoconstant' => array(
229 'optionGroupName' => 'note_privacy',
230 'optionEditPath' => 'civicrm/admin/options/note_privacy',
234 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
236 return Civi
::$statics[__CLASS__
]['fields'];
239 * Return a mapping from field-name to the corresponding key (as used in fields()).
242 * Array(string $name => string $uniqueName).
244 static function &fieldKeys() {
245 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
246 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
248 return Civi
::$statics[__CLASS__
]['fieldKeys'];
251 * Returns the names of this table
255 static function getTableName() {
256 return self
::$_tableName;
259 * Returns if this table needs to be logged
267 * Returns the list of fields that can be imported
269 * @param bool $prefix
273 static function &import($prefix = false) {
274 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'note', $prefix, array());
278 * Returns the list of fields that can be exported
280 * @param bool $prefix
284 static function &export($prefix = false) {
285 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'note', $prefix, array());