Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
8c9251b3 | 5 | * @copyright CiviCRM LLC (c) 2004-2018 |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Campaign/CampaignGroup.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
022785d8 | 9 | * (GenCodeChecksum:16989135f9745e57028278a41cc303ea) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the CampaignGroup entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Campaign_DAO_CampaignGroup extends CRM_Core_DAO { |
c3fc2621 | 16 | |
e501603b | 17 | /** |
f41f0342 | 18 | * Static instance to hold the table name. |
e501603b TO |
19 | * |
20 | * @var string | |
21 | */ | |
22 | static $_tableName = 'civicrm_campaign_group'; | |
c3fc2621 | 23 | |
e501603b | 24 | /** |
f41f0342 | 25 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 26 | * |
c3fc2621 | 27 | * @var bool |
e501603b | 28 | */ |
c3fc2621 CW |
29 | static $_log = FALSE; |
30 | ||
e501603b TO |
31 | /** |
32 | * Campaign Group id. | |
33 | * | |
34 | * @var int unsigned | |
35 | */ | |
36 | public $id; | |
c3fc2621 | 37 | |
e501603b TO |
38 | /** |
39 | * Foreign key to the activity Campaign. | |
40 | * | |
41 | * @var int unsigned | |
42 | */ | |
43 | public $campaign_id; | |
c3fc2621 | 44 | |
e501603b TO |
45 | /** |
46 | * Type of Group. | |
47 | * | |
48 | * @var string | |
49 | */ | |
50 | public $group_type; | |
c3fc2621 | 51 | |
e501603b TO |
52 | /** |
53 | * Name of table where item being referenced is stored. | |
54 | * | |
55 | * @var string | |
56 | */ | |
57 | public $entity_table; | |
c3fc2621 | 58 | |
e501603b TO |
59 | /** |
60 | * Entity id of referenced table. | |
61 | * | |
62 | * @var int unsigned | |
63 | */ | |
64 | public $entity_id; | |
c3fc2621 | 65 | |
e501603b | 66 | /** |
f41f0342 | 67 | * Class constructor. |
e501603b | 68 | */ |
c3fc2621 | 69 | public function __construct() { |
e501603b TO |
70 | $this->__table = 'civicrm_campaign_group'; |
71 | parent::__construct(); | |
72 | } | |
c3fc2621 | 73 | |
e501603b | 74 | /** |
f41f0342 | 75 | * Returns foreign keys and entity references. |
e501603b TO |
76 | * |
77 | * @return array | |
78 | * [CRM_Core_Reference_Interface] | |
79 | */ | |
c3fc2621 | 80 | public static function getReferenceColumns() { |
346aaaba TO |
81 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
82 | Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__); | |
c3fc2621 CW |
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'); | |
346aaaba | 85 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 86 | } |
346aaaba | 87 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 88 | } |
c3fc2621 | 89 | |
e501603b TO |
90 | /** |
91 | * Returns all the column names of this table | |
92 | * | |
93 | * @return array | |
94 | */ | |
c3fc2621 | 95 | public static function &fields() { |
346aaaba | 96 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
97 | Civi::$statics[__CLASS__]['fields'] = [ |
98 | 'id' => [ | |
e501603b TO |
99 | 'name' => 'id', |
100 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 101 | 'title' => ts('Campaign Group ID'), |
e501603b | 102 | 'description' => 'Campaign Group id.', |
c3fc2621 | 103 | 'required' => TRUE, |
522a26c9 | 104 | 'table_name' => 'civicrm_campaign_group', |
105 | 'entity' => 'CampaignGroup', | |
106 | 'bao' => 'CRM_Campaign_DAO_CampaignGroup', | |
6a7e5e5d | 107 | 'localizable' => 0, |
c3fc2621 CW |
108 | ], |
109 | 'campaign_id' => [ | |
e501603b TO |
110 | 'name' => 'campaign_id', |
111 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 112 | 'title' => ts('Campaign'), |
e501603b | 113 | 'description' => 'Foreign key to the activity Campaign.', |
c3fc2621 | 114 | 'required' => TRUE, |
522a26c9 | 115 | 'table_name' => 'civicrm_campaign_group', |
116 | 'entity' => 'CampaignGroup', | |
117 | 'bao' => 'CRM_Campaign_DAO_CampaignGroup', | |
6a7e5e5d | 118 | 'localizable' => 0, |
e501603b | 119 | 'FKClassName' => 'CRM_Campaign_DAO_Campaign', |
c3fc2621 | 120 | 'pseudoconstant' => [ |
e501603b TO |
121 | 'table' => 'civicrm_campaign', |
122 | 'keyColumn' => 'id', | |
123 | 'labelColumn' => 'title', | |
c3fc2621 CW |
124 | ] |
125 | ], | |
126 | 'group_type' => [ | |
e501603b TO |
127 | 'name' => 'group_type', |
128 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 129 | 'title' => ts('Campaign Group Type'), |
e501603b TO |
130 | 'description' => 'Type of Group.', |
131 | 'maxlength' => 8, | |
132 | 'size' => CRM_Utils_Type::EIGHT, | |
133 | 'default' => 'NULL', | |
522a26c9 | 134 | 'table_name' => 'civicrm_campaign_group', |
135 | 'entity' => 'CampaignGroup', | |
136 | 'bao' => 'CRM_Campaign_DAO_CampaignGroup', | |
6a7e5e5d | 137 | 'localizable' => 0, |
c3fc2621 | 138 | 'html' => [ |
e501603b | 139 | 'type' => 'Select', |
c3fc2621 CW |
140 | ], |
141 | 'pseudoconstant' => [ | |
e501603b | 142 | 'callback' => 'CRM_Core_SelectValues::getCampaignGroupTypes', |
c3fc2621 CW |
143 | ] |
144 | ], | |
145 | 'entity_table' => [ | |
e501603b TO |
146 | 'name' => 'entity_table', |
147 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 148 | 'title' => ts('Entity Table'), |
e501603b TO |
149 | 'description' => 'Name of table where item being referenced is stored.', |
150 | 'maxlength' => 64, | |
151 | 'size' => CRM_Utils_Type::BIG, | |
152 | 'default' => 'NULL', | |
522a26c9 | 153 | 'table_name' => 'civicrm_campaign_group', |
154 | 'entity' => 'CampaignGroup', | |
155 | 'bao' => 'CRM_Campaign_DAO_CampaignGroup', | |
6a7e5e5d | 156 | 'localizable' => 0, |
c3fc2621 CW |
157 | ], |
158 | 'entity_id' => [ | |
e501603b TO |
159 | 'name' => 'entity_id', |
160 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 161 | 'title' => ts('Entity ID'), |
e501603b TO |
162 | 'description' => 'Entity id of referenced table.', |
163 | 'default' => 'NULL', | |
522a26c9 | 164 | 'table_name' => 'civicrm_campaign_group', |
165 | 'entity' => 'CampaignGroup', | |
166 | 'bao' => 'CRM_Campaign_DAO_CampaignGroup', | |
6a7e5e5d | 167 | 'localizable' => 0, |
c3fc2621 CW |
168 | ], |
169 | ]; | |
346aaaba | 170 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 171 | } |
346aaaba | 172 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 173 | } |
c3fc2621 | 174 | |
e501603b | 175 | /** |
bd8e0b14 | 176 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
177 | * |
178 | * @return array | |
bd8e0b14 | 179 | * Array(string $name => string $uniqueName). |
e501603b | 180 | */ |
c3fc2621 | 181 | public static function &fieldKeys() { |
bd8e0b14 TO |
182 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
183 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 184 | } |
bd8e0b14 | 185 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 186 | } |
c3fc2621 | 187 | |
e501603b TO |
188 | /** |
189 | * Returns the names of this table | |
190 | * | |
191 | * @return string | |
192 | */ | |
c3fc2621 | 193 | public static function getTableName() { |
e501603b TO |
194 | return self::$_tableName; |
195 | } | |
c3fc2621 | 196 | |
e501603b TO |
197 | /** |
198 | * Returns if this table needs to be logged | |
199 | * | |
c3fc2621 | 200 | * @return bool |
e501603b | 201 | */ |
c3fc2621 | 202 | public function getLog() { |
e501603b TO |
203 | return self::$_log; |
204 | } | |
c3fc2621 | 205 | |
e501603b TO |
206 | /** |
207 | * Returns the list of fields that can be imported | |
208 | * | |
209 | * @param bool $prefix | |
210 | * | |
211 | * @return array | |
212 | */ | |
c3fc2621 CW |
213 | public static function &import($prefix = FALSE) { |
214 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'campaign_group', $prefix, []); | |
60808919 | 215 | return $r; |
e501603b | 216 | } |
c3fc2621 | 217 | |
e501603b TO |
218 | /** |
219 | * Returns the list of fields that can be exported | |
220 | * | |
221 | * @param bool $prefix | |
222 | * | |
223 | * @return array | |
224 | */ | |
c3fc2621 CW |
225 | public static function &export($prefix = FALSE) { |
226 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'campaign_group', $prefix, []); | |
60808919 | 227 | return $r; |
e501603b | 228 | } |
c3fc2621 | 229 | |
e7a6b91a AS |
230 | /** |
231 | * Returns the list of indices | |
c3fc2621 CW |
232 | * |
233 | * @param bool $localize | |
234 | * | |
235 | * @return array | |
e7a6b91a AS |
236 | */ |
237 | public static function indices($localize = TRUE) { | |
c3fc2621 | 238 | $indices = []; |
e7a6b91a AS |
239 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
240 | } | |
c3fc2621 | 241 | |
e501603b | 242 | } |