3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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-2015
31 * Generated from xml/schema/CRM/Core/Tag.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Core_DAO_Tag
extends CRM_Core_DAO
{
38 * static instance to hold the table name
42 static $_tableName = 'civicrm_tag';
44 * static instance to hold the field values
48 static $_fields = null;
50 * static instance to hold the keys used in $_fields for each field.
54 static $_fieldKeys = null;
56 * static instance to hold the FK relationships
60 static $_links = null;
62 * static instance to hold the values that can
67 static $_import = null;
69 * static instance to hold the values that can
74 static $_export = null;
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
95 * Optional verbose description of the tag.
101 * Optional parent id for this tag.
107 * Is this tag selectable / displayed
111 public $is_selectable;
128 * FK to civicrm_contact, who created this tag
134 * Date and time that tag was created.
138 public $created_date;
142 * @return civicrm_tag
144 function __construct() {
145 $this->__table
= 'civicrm_tag';
146 parent
::__construct();
149 * Returns foreign keys and entity references
152 * [CRM_Core_Reference_Interface]
154 static function getReferenceColumns() {
155 if (!self
::$_links) {
156 self
::$_links = static ::createReferenceColumns(__CLASS__
);
157 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'parent_id', 'civicrm_tag', 'id');
158 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
160 return self
::$_links;
163 * Returns all the column names of this table
167 static function &fields() {
168 if (!(self
::$_fields)) {
169 self
::$_fields = array(
172 'type' => CRM_Utils_Type
::T_INT
,
173 'title' => ts('Tag ID') ,
174 'description' => 'Tag ID',
179 'type' => CRM_Utils_Type
::T_STRING
,
180 'title' => ts('Tag Name') ,
181 'description' => 'Name of Tag.',
184 'size' => CRM_Utils_Type
::BIG
,
186 'description' => array(
187 'name' => 'description',
188 'type' => CRM_Utils_Type
::T_STRING
,
189 'title' => ts('Description') ,
190 'description' => 'Optional verbose description of the tag.',
192 'size' => CRM_Utils_Type
::HUGE
,
194 'parent_id' => array(
195 'name' => 'parent_id',
196 'type' => CRM_Utils_Type
::T_INT
,
197 'title' => ts('Parent Tag') ,
198 'description' => 'Optional parent id for this tag.',
200 'FKClassName' => 'CRM_Core_DAO_Tag',
202 'is_selectable' => array(
203 'name' => 'is_selectable',
204 'type' => CRM_Utils_Type
::T_BOOLEAN
,
205 'title' => ts('Display Tag?') ,
206 'description' => 'Is this tag selectable / displayed',
209 'is_reserved' => array(
210 'name' => 'is_reserved',
211 'type' => CRM_Utils_Type
::T_BOOLEAN
,
212 'title' => ts('Reserved') ,
214 'is_tagset' => array(
215 'name' => 'is_tagset',
216 'type' => CRM_Utils_Type
::T_BOOLEAN
,
217 'title' => ts('Tagset') ,
220 'name' => 'used_for',
221 'type' => CRM_Utils_Type
::T_STRING
,
222 'title' => ts('Used For') ,
224 'size' => CRM_Utils_Type
::BIG
,
229 'pseudoconstant' => array(
230 'optionGroupName' => 'tag_used_for',
231 'optionEditPath' => 'civicrm/admin/options/tag_used_for',
234 'created_id' => array(
235 'name' => 'created_id',
236 'type' => CRM_Utils_Type
::T_INT
,
237 'title' => ts('Tag Created By') ,
238 'description' => 'FK to civicrm_contact, who created this tag',
239 'FKClassName' => 'CRM_Contact_DAO_Contact',
241 'created_date' => array(
242 'name' => 'created_date',
243 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
244 'title' => ts('Tag Created Date') ,
245 'description' => 'Date and time that tag was created.',
249 return self
::$_fields;
252 * Returns an array containing, for each field, the arary key used for that
253 * field in self::$_fields.
257 static function &fieldKeys() {
258 if (!(self
::$_fieldKeys)) {
259 self
::$_fieldKeys = array(
262 'description' => 'description',
263 'parent_id' => 'parent_id',
264 'is_selectable' => 'is_selectable',
265 'is_reserved' => 'is_reserved',
266 'is_tagset' => 'is_tagset',
267 'used_for' => 'used_for',
268 'created_id' => 'created_id',
269 'created_date' => 'created_date',
272 return self
::$_fieldKeys;
275 * Returns the names of this table
279 static function getTableName() {
280 return self
::$_tableName;
283 * Returns if this table needs to be logged
291 * Returns the list of fields that can be imported
293 * @param bool $prefix
297 static function &import($prefix = false) {
298 if (!(self
::$_import)) {
299 self
::$_import = array();
300 $fields = self
::fields();
301 foreach($fields as $name => $field) {
302 if (CRM_Utils_Array
::value('import', $field)) {
304 self
::$_import['tag'] = & $fields[$name];
306 self
::$_import[$name] = & $fields[$name];
311 return self
::$_import;
314 * Returns the list of fields that can be exported
316 * @param bool $prefix
320 static function &export($prefix = false) {
321 if (!(self
::$_export)) {
322 self
::$_export = array();
323 $fields = self
::fields();
324 foreach($fields as $name => $field) {
325 if (CRM_Utils_Array
::value('export', $field)) {
327 self
::$_export['tag'] = & $fields[$name];
329 self
::$_export[$name] = & $fields[$name];
334 return self
::$_export;