5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Campaign/CampaignGroup.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:74c02a4708ef706860d023c1635b98c4)
13 * Database access object for the CampaignGroup entity.
15 class CRM_Campaign_DAO_CampaignGroup
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '3.3';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_campaign_group';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
41 * Foreign key to the activity Campaign.
55 * Name of table where item being referenced is stored.
62 * Entity id of referenced table.
71 public function __construct() {
72 $this->__table
= 'civicrm_campaign_group';
73 parent
::__construct();
77 * Returns localized title of this entity.
79 public static function getEntityTitle() {
80 return ts('Campaign Groups');
84 * Returns foreign keys and entity references.
87 * [CRM_Core_Reference_Interface]
89 public static function getReferenceColumns() {
90 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
91 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
92 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'campaign_id', 'civicrm_campaign', 'id');
93 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
94 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
96 return Civi
::$statics[__CLASS__
]['links'];
100 * Returns all the column names of this table
104 public static function &fields() {
105 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
106 Civi
::$statics[__CLASS__
]['fields'] = [
109 'type' => CRM_Utils_Type
::T_INT
,
110 'title' => ts('Campaign Group ID'),
111 'description' => ts('Campaign Group id.'),
113 'where' => 'civicrm_campaign_group.id',
114 'table_name' => 'civicrm_campaign_group',
115 'entity' => 'CampaignGroup',
116 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
121 'name' => 'campaign_id',
122 'type' => CRM_Utils_Type
::T_INT
,
123 'title' => ts('Campaign'),
124 'description' => ts('Foreign key to the activity Campaign.'),
126 'where' => 'civicrm_campaign_group.campaign_id',
127 'table_name' => 'civicrm_campaign_group',
128 'entity' => 'CampaignGroup',
129 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
131 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
132 'pseudoconstant' => [
133 'table' => 'civicrm_campaign',
135 'labelColumn' => 'title',
140 'name' => 'group_type',
141 'type' => CRM_Utils_Type
::T_STRING
,
142 'title' => ts('Campaign Group Type'),
143 'description' => ts('Type of Group.'),
145 'size' => CRM_Utils_Type
::EIGHT
,
146 'where' => 'civicrm_campaign_group.group_type',
148 'table_name' => 'civicrm_campaign_group',
149 'entity' => 'CampaignGroup',
150 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
155 'pseudoconstant' => [
156 'callback' => 'CRM_Core_SelectValues::getCampaignGroupTypes',
161 'name' => 'entity_table',
162 'type' => CRM_Utils_Type
::T_STRING
,
163 'title' => ts('Entity Table'),
164 'description' => ts('Name of table where item being referenced is stored.'),
166 'size' => CRM_Utils_Type
::BIG
,
167 'where' => 'civicrm_campaign_group.entity_table',
169 'table_name' => 'civicrm_campaign_group',
170 'entity' => 'CampaignGroup',
171 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
176 'name' => 'entity_id',
177 'type' => CRM_Utils_Type
::T_INT
,
178 'title' => ts('Entity ID'),
179 'description' => ts('Entity id of referenced table.'),
180 'where' => 'civicrm_campaign_group.entity_id',
182 'table_name' => 'civicrm_campaign_group',
183 'entity' => 'CampaignGroup',
184 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
189 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
191 return Civi
::$statics[__CLASS__
]['fields'];
195 * Return a mapping from field-name to the corresponding key (as used in fields()).
198 * Array(string $name => string $uniqueName).
200 public static function &fieldKeys() {
201 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
202 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
204 return Civi
::$statics[__CLASS__
]['fieldKeys'];
208 * Returns the names of this table
212 public static function getTableName() {
213 return self
::$_tableName;
217 * Returns if this table needs to be logged
221 public function getLog() {
226 * Returns the list of fields that can be imported
228 * @param bool $prefix
232 public static function &import($prefix = FALSE) {
233 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'campaign_group', $prefix, []);
238 * Returns the list of fields that can be exported
240 * @param bool $prefix
244 public static function &export($prefix = FALSE) {
245 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'campaign_group', $prefix, []);
250 * Returns the list of indices
252 * @param bool $localize
256 public static function indices($localize = TRUE) {
258 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;