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:c245f47a5db1f3cd039da4cf06b667d1)
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 public static $_tableName = 'civicrm_campaign_group';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
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 localized title of this entity.
77 public static function getEntityTitle() {
78 return ts('Campaign Groups');
82 * Returns foreign keys and entity references.
85 * [CRM_Core_Reference_Interface]
87 public static function getReferenceColumns() {
88 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
89 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
90 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'campaign_id', 'civicrm_campaign', 'id');
91 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
92 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
94 return Civi
::$statics[__CLASS__
]['links'];
98 * Returns all the column names of this table
102 public static function &fields() {
103 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
104 Civi
::$statics[__CLASS__
]['fields'] = [
107 'type' => CRM_Utils_Type
::T_INT
,
108 'title' => ts('Campaign Group ID'),
109 'description' => ts('Campaign Group id.'),
111 'where' => 'civicrm_campaign_group.id',
112 'table_name' => 'civicrm_campaign_group',
113 'entity' => 'CampaignGroup',
114 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
118 'name' => 'campaign_id',
119 'type' => CRM_Utils_Type
::T_INT
,
120 'title' => ts('Campaign'),
121 'description' => ts('Foreign key to the activity Campaign.'),
123 'where' => 'civicrm_campaign_group.campaign_id',
124 'table_name' => 'civicrm_campaign_group',
125 'entity' => 'CampaignGroup',
126 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
128 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
129 'pseudoconstant' => [
130 'table' => 'civicrm_campaign',
132 'labelColumn' => 'title',
136 'name' => 'group_type',
137 'type' => CRM_Utils_Type
::T_STRING
,
138 'title' => ts('Campaign Group Type'),
139 'description' => ts('Type of Group.'),
141 'size' => CRM_Utils_Type
::EIGHT
,
142 'where' => 'civicrm_campaign_group.group_type',
144 'table_name' => 'civicrm_campaign_group',
145 'entity' => 'CampaignGroup',
146 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
151 'pseudoconstant' => [
152 'callback' => 'CRM_Core_SelectValues::getCampaignGroupTypes',
156 'name' => 'entity_table',
157 'type' => CRM_Utils_Type
::T_STRING
,
158 'title' => ts('Entity Table'),
159 'description' => ts('Name of table where item being referenced is stored.'),
161 'size' => CRM_Utils_Type
::BIG
,
162 'where' => 'civicrm_campaign_group.entity_table',
164 'table_name' => 'civicrm_campaign_group',
165 'entity' => 'CampaignGroup',
166 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
170 'name' => 'entity_id',
171 'type' => CRM_Utils_Type
::T_INT
,
172 'title' => ts('Entity ID'),
173 'description' => ts('Entity id of referenced table.'),
174 'where' => 'civicrm_campaign_group.entity_id',
176 'table_name' => 'civicrm_campaign_group',
177 'entity' => 'CampaignGroup',
178 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
182 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
184 return Civi
::$statics[__CLASS__
]['fields'];
188 * Return a mapping from field-name to the corresponding key (as used in fields()).
191 * Array(string $name => string $uniqueName).
193 public static function &fieldKeys() {
194 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
195 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
197 return Civi
::$statics[__CLASS__
]['fieldKeys'];
201 * Returns the names of this table
205 public static function getTableName() {
206 return self
::$_tableName;
210 * Returns if this table needs to be logged
214 public function getLog() {
219 * Returns the list of fields that can be imported
221 * @param bool $prefix
225 public static function &import($prefix = FALSE) {
226 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'campaign_group', $prefix, []);
231 * Returns the list of fields that can be exported
233 * @param bool $prefix
237 public static function &export($prefix = FALSE) {
238 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'campaign_group', $prefix, []);
243 * Returns the list of indices
245 * @param bool $localize
249 public static function indices($localize = TRUE) {
251 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;