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/Tag.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:eb22ef992569566021a7faeaf43f0c25)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Core_DAO_Tag constructor.
40 class CRM_Core_DAO_Tag
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_tag';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
66 * Optional verbose description of the tag.
72 * Optional parent id for this tag.
78 * Is this tag selectable / displayed
82 public $is_selectable;
99 * FK to civicrm_contact, who created this tag
105 * Hex color value e.g. #ffffff
111 * Date and time that tag was created.
115 public $created_date;
119 function __construct() {
120 $this->__table
= 'civicrm_tag';
121 parent
::__construct();
124 * Returns foreign keys and entity references.
127 * [CRM_Core_Reference_Interface]
129 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() , 'parent_id', 'civicrm_tag', 'id');
133 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
134 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
136 return Civi
::$statics[__CLASS__
]['links'];
139 * Returns all the column names of this table
143 static function &fields() {
144 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
145 Civi
::$statics[__CLASS__
]['fields'] = array(
148 'type' => CRM_Utils_Type
::T_INT
,
149 'title' => ts('Tag ID') ,
150 'description' => 'Tag ID',
152 'table_name' => 'civicrm_tag',
154 'bao' => 'CRM_Core_BAO_Tag',
159 'type' => CRM_Utils_Type
::T_STRING
,
160 'title' => ts('Tag Name') ,
161 'description' => 'Name of Tag.',
164 'size' => CRM_Utils_Type
::BIG
,
165 'table_name' => 'civicrm_tag',
167 'bao' => 'CRM_Core_BAO_Tag',
170 'description' => array(
171 'name' => 'description',
172 'type' => CRM_Utils_Type
::T_STRING
,
173 'title' => ts('Description') ,
174 'description' => 'Optional verbose description of the tag.',
176 'size' => CRM_Utils_Type
::HUGE
,
177 'table_name' => 'civicrm_tag',
179 'bao' => 'CRM_Core_BAO_Tag',
182 'parent_id' => array(
183 'name' => 'parent_id',
184 'type' => CRM_Utils_Type
::T_INT
,
185 'title' => ts('Parent Tag') ,
186 'description' => 'Optional parent id for this tag.',
188 'table_name' => 'civicrm_tag',
190 'bao' => 'CRM_Core_BAO_Tag',
192 'FKClassName' => 'CRM_Core_DAO_Tag',
194 'is_selectable' => array(
195 'name' => 'is_selectable',
196 'type' => CRM_Utils_Type
::T_BOOLEAN
,
197 'title' => ts('Display Tag?') ,
198 'description' => 'Is this tag selectable / displayed',
200 'table_name' => 'civicrm_tag',
202 'bao' => 'CRM_Core_BAO_Tag',
205 'is_reserved' => array(
206 'name' => 'is_reserved',
207 'type' => CRM_Utils_Type
::T_BOOLEAN
,
208 'title' => ts('Reserved') ,
209 'table_name' => 'civicrm_tag',
211 'bao' => 'CRM_Core_BAO_Tag',
214 'is_tagset' => array(
215 'name' => 'is_tagset',
216 'type' => CRM_Utils_Type
::T_BOOLEAN
,
217 'title' => ts('Tagset') ,
218 'table_name' => 'civicrm_tag',
220 'bao' => 'CRM_Core_BAO_Tag',
224 'name' => 'used_for',
225 'type' => CRM_Utils_Type
::T_STRING
,
226 'title' => ts('Used For') ,
228 'size' => CRM_Utils_Type
::BIG
,
230 'table_name' => 'civicrm_tag',
232 'bao' => 'CRM_Core_BAO_Tag',
237 'pseudoconstant' => array(
238 'optionGroupName' => 'tag_used_for',
239 'optionEditPath' => 'civicrm/admin/options/tag_used_for',
242 'created_id' => array(
243 'name' => 'created_id',
244 'type' => CRM_Utils_Type
::T_INT
,
245 'title' => ts('Tag Created By') ,
246 'description' => 'FK to civicrm_contact, who created this tag',
247 'table_name' => 'civicrm_tag',
249 'bao' => 'CRM_Core_BAO_Tag',
251 'FKClassName' => 'CRM_Contact_DAO_Contact',
255 'type' => CRM_Utils_Type
::T_STRING
,
256 'title' => ts('Color') ,
257 'description' => 'Hex color value e.g. #ffffff',
259 'size' => CRM_Utils_Type
::HUGE
,
261 'table_name' => 'civicrm_tag',
263 'bao' => 'CRM_Core_BAO_Tag',
266 'created_date' => array(
267 'name' => 'created_date',
268 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
269 'title' => ts('Tag Created Date') ,
270 'description' => 'Date and time that tag was created.',
271 'table_name' => 'civicrm_tag',
273 'bao' => 'CRM_Core_BAO_Tag',
277 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
279 return Civi
::$statics[__CLASS__
]['fields'];
282 * Return a mapping from field-name to the corresponding key (as used in fields()).
285 * Array(string $name => string $uniqueName).
287 static function &fieldKeys() {
288 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
289 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
291 return Civi
::$statics[__CLASS__
]['fieldKeys'];
294 * Returns the names of this table
298 static function getTableName() {
299 return self
::$_tableName;
302 * Returns if this table needs to be logged
310 * Returns the list of fields that can be imported
312 * @param bool $prefix
316 static function &import($prefix = false) {
317 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'tag', $prefix, array());
321 * Returns the list of fields that can be exported
323 * @param bool $prefix
327 static function &export($prefix = false) {
328 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'tag', $prefix, array());
332 * Returns the list of indices
334 public static function indices($localize = TRUE) {
341 'localizable' => false,
343 'sig' => 'civicrm_tag::1::name',
346 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;