5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Campaign/CampaignGroup.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:9c9ee0c8ea79ddd0f680e8050693e5db)
13 * Database access object for the CampaignGroup entity.
15 class CRM_Campaign_DAO_CampaignGroup
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_campaign_group';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
39 * Foreign key to the activity Campaign.
53 * Name of table where item being referenced is stored.
60 * Entity id of referenced table.
69 public function __construct() {
70 $this->__table
= 'civicrm_campaign_group';
71 parent
::__construct();
75 * Returns foreign keys and entity references.
78 * [CRM_Core_Reference_Interface]
80 public static function getReferenceColumns() {
81 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
82 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
83 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'campaign_id', 'civicrm_campaign', 'id');
84 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
85 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
87 return Civi
::$statics[__CLASS__
]['links'];
91 * Returns all the column names of this table
95 public static function &fields() {
96 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
97 Civi
::$statics[__CLASS__
]['fields'] = [
100 'type' => CRM_Utils_Type
::T_INT
,
101 'title' => ts('Campaign Group ID'),
102 'description' => ts('Campaign Group id.'),
104 'table_name' => 'civicrm_campaign_group',
105 'entity' => 'CampaignGroup',
106 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
110 'name' => 'campaign_id',
111 'type' => CRM_Utils_Type
::T_INT
,
112 'title' => ts('Campaign'),
113 'description' => ts('Foreign key to the activity Campaign.'),
115 'table_name' => 'civicrm_campaign_group',
116 'entity' => 'CampaignGroup',
117 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
119 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
120 'pseudoconstant' => [
121 'table' => 'civicrm_campaign',
123 'labelColumn' => 'title',
127 'name' => 'group_type',
128 'type' => CRM_Utils_Type
::T_STRING
,
129 'title' => ts('Campaign Group Type'),
130 'description' => ts('Type of Group.'),
132 'size' => CRM_Utils_Type
::EIGHT
,
134 'table_name' => 'civicrm_campaign_group',
135 'entity' => 'CampaignGroup',
136 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
141 'pseudoconstant' => [
142 'callback' => 'CRM_Core_SelectValues::getCampaignGroupTypes',
146 'name' => 'entity_table',
147 'type' => CRM_Utils_Type
::T_STRING
,
148 'title' => ts('Entity Table'),
149 'description' => ts('Name of table where item being referenced is stored.'),
151 'size' => CRM_Utils_Type
::BIG
,
153 'table_name' => 'civicrm_campaign_group',
154 'entity' => 'CampaignGroup',
155 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
159 'name' => 'entity_id',
160 'type' => CRM_Utils_Type
::T_INT
,
161 'title' => ts('Entity ID'),
162 'description' => ts('Entity id of referenced table.'),
164 'table_name' => 'civicrm_campaign_group',
165 'entity' => 'CampaignGroup',
166 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
170 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
172 return Civi
::$statics[__CLASS__
]['fields'];
176 * Return a mapping from field-name to the corresponding key (as used in fields()).
179 * Array(string $name => string $uniqueName).
181 public static function &fieldKeys() {
182 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
183 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
185 return Civi
::$statics[__CLASS__
]['fieldKeys'];
189 * Returns the names of this table
193 public static function getTableName() {
194 return self
::$_tableName;
198 * Returns if this table needs to be logged
202 public function getLog() {
207 * Returns the list of fields that can be imported
209 * @param bool $prefix
213 public static function &import($prefix = FALSE) {
214 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'campaign_group', $prefix, []);
219 * Returns the list of fields that can be exported
221 * @param bool $prefix
225 public static function &export($prefix = FALSE) {
226 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'campaign_group', $prefix, []);
231 * Returns the list of indices
233 * @param bool $localize
237 public static function indices($localize = TRUE) {
239 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;