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/Campaign/CampaignGroup.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_Campaign_DAO_CampaignGroup
extends CRM_Core_DAO
{
38 * static instance to hold the table name
42 static $_tableName = 'civicrm_campaign_group';
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
89 * Foreign key to the activity Campaign.
101 * Name of table where item being referenced is stored.
105 public $entity_table;
107 * Entity id of referenced table.
115 * @return civicrm_campaign_group
117 function __construct() {
118 $this->__table
= 'civicrm_campaign_group';
119 parent
::__construct();
122 * Returns foreign keys and entity references
125 * [CRM_Core_Reference_Interface]
127 static function getReferenceColumns() {
128 if (!self
::$_links) {
129 self
::$_links = static ::createReferenceColumns(__CLASS__
);
130 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'campaign_id', 'civicrm_campaign', 'id');
131 self
::$_links[] = new CRM_Core_Reference_Dynamic(self
::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
133 return self
::$_links;
136 * Returns all the column names of this table
140 static function &fields() {
141 if (!(self
::$_fields)) {
142 self
::$_fields = array(
145 'type' => CRM_Utils_Type
::T_INT
,
146 'description' => 'Campaign Group id.',
149 'campaign_id' => array(
150 'name' => 'campaign_id',
151 'type' => CRM_Utils_Type
::T_INT
,
152 'description' => 'Foreign key to the activity Campaign.',
154 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
155 'pseudoconstant' => array(
156 'table' => 'civicrm_campaign',
158 'labelColumn' => 'title',
161 'group_type' => array(
162 'name' => 'group_type',
163 'type' => CRM_Utils_Type
::T_STRING
,
164 'title' => ts('Group Type') ,
165 'description' => 'Type of Group.',
167 'size' => CRM_Utils_Type
::EIGHT
,
172 'pseudoconstant' => array(
173 'callback' => 'CRM_Core_SelectValues::getCampaignGroupTypes',
176 'entity_table' => array(
177 'name' => 'entity_table',
178 'type' => CRM_Utils_Type
::T_STRING
,
179 'title' => ts('Entity Table') ,
180 'description' => 'Name of table where item being referenced is stored.',
182 'size' => CRM_Utils_Type
::BIG
,
185 'entity_id' => array(
186 'name' => 'entity_id',
187 'type' => CRM_Utils_Type
::T_INT
,
188 'description' => 'Entity id of referenced table.',
193 return self
::$_fields;
196 * Returns an array containing, for each field, the arary key used for that
197 * field in self::$_fields.
201 static function &fieldKeys() {
202 if (!(self
::$_fieldKeys)) {
203 self
::$_fieldKeys = array(
205 'campaign_id' => 'campaign_id',
206 'group_type' => 'group_type',
207 'entity_table' => 'entity_table',
208 'entity_id' => 'entity_id',
211 return self
::$_fieldKeys;
214 * Returns the names of this table
218 static function getTableName() {
219 return self
::$_tableName;
222 * Returns if this table needs to be logged
230 * Returns the list of fields that can be imported
232 * @param bool $prefix
236 static function &import($prefix = false) {
237 if (!(self
::$_import)) {
238 self
::$_import = array();
239 $fields = self
::fields();
240 foreach($fields as $name => $field) {
241 if (CRM_Utils_Array
::value('import', $field)) {
243 self
::$_import['campaign_group'] = & $fields[$name];
245 self
::$_import[$name] = & $fields[$name];
250 return self
::$_import;
253 * Returns the list of fields that can be exported
255 * @param bool $prefix
259 static function &export($prefix = false) {
260 if (!(self
::$_export)) {
261 self
::$_export = array();
262 $fields = self
::fields();
263 foreach($fields as $name => $field) {
264 if (CRM_Utils_Array
::value('export', $field)) {
266 self
::$_export['campaign_group'] = & $fields[$name];
268 self
::$_export[$name] = & $fields[$name];
273 return self
::$_export;