5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Campaign/CampaignGroup.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:c67604933af69d768aa2f989e082bc11)
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 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 'where' => 'civicrm_campaign_group.id',
105 'table_name' => 'civicrm_campaign_group',
106 'entity' => 'CampaignGroup',
107 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
111 'name' => 'campaign_id',
112 'type' => CRM_Utils_Type
::T_INT
,
113 'title' => ts('Campaign'),
114 'description' => ts('Foreign key to the activity Campaign.'),
116 'where' => 'civicrm_campaign_group.campaign_id',
117 'table_name' => 'civicrm_campaign_group',
118 'entity' => 'CampaignGroup',
119 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
121 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
122 'pseudoconstant' => [
123 'table' => 'civicrm_campaign',
125 'labelColumn' => 'title',
129 'name' => 'group_type',
130 'type' => CRM_Utils_Type
::T_STRING
,
131 'title' => ts('Campaign Group Type'),
132 'description' => ts('Type of Group.'),
134 'size' => CRM_Utils_Type
::EIGHT
,
135 'where' => 'civicrm_campaign_group.group_type',
137 'table_name' => 'civicrm_campaign_group',
138 'entity' => 'CampaignGroup',
139 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
144 'pseudoconstant' => [
145 'callback' => 'CRM_Core_SelectValues::getCampaignGroupTypes',
149 'name' => 'entity_table',
150 'type' => CRM_Utils_Type
::T_STRING
,
151 'title' => ts('Entity Table'),
152 'description' => ts('Name of table where item being referenced is stored.'),
154 'size' => CRM_Utils_Type
::BIG
,
155 'where' => 'civicrm_campaign_group.entity_table',
157 'table_name' => 'civicrm_campaign_group',
158 'entity' => 'CampaignGroup',
159 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
163 'name' => 'entity_id',
164 'type' => CRM_Utils_Type
::T_INT
,
165 'title' => ts('Entity ID'),
166 'description' => ts('Entity id of referenced table.'),
167 'where' => 'civicrm_campaign_group.entity_id',
169 'table_name' => 'civicrm_campaign_group',
170 'entity' => 'CampaignGroup',
171 'bao' => 'CRM_Campaign_DAO_CampaignGroup',
175 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
177 return Civi
::$statics[__CLASS__
]['fields'];
181 * Return a mapping from field-name to the corresponding key (as used in fields()).
184 * Array(string $name => string $uniqueName).
186 public static function &fieldKeys() {
187 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
188 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
190 return Civi
::$statics[__CLASS__
]['fieldKeys'];
194 * Returns the names of this table
198 public static function getTableName() {
199 return self
::$_tableName;
203 * Returns if this table needs to be logged
207 public function getLog() {
212 * Returns the list of fields that can be imported
214 * @param bool $prefix
218 public static function &import($prefix = FALSE) {
219 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'campaign_group', $prefix, []);
224 * Returns the list of fields that can be exported
226 * @param bool $prefix
230 public static function &export($prefix = FALSE) {
231 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'campaign_group', $prefix, []);
236 * Returns the list of indices
238 * @param bool $localize
242 public static function indices($localize = TRUE) {
244 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;