commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-old / civicrm / CRM / Mailing / DAO / MailingGroup.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2015
30 *
31 * Generated from xml/schema/CRM/Mailing/MailingGroup.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 */
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Mailing_DAO_MailingGroup extends CRM_Core_DAO {
37 /**
38 * static instance to hold the table name
39 *
40 * @var string
41 */
42 static $_tableName = 'civicrm_mailing_group';
43 /**
44 * static instance to hold the field values
45 *
46 * @var array
47 */
48 static $_fields = null;
49 /**
50 * static instance to hold the keys used in $_fields for each field.
51 *
52 * @var array
53 */
54 static $_fieldKeys = null;
55 /**
56 * static instance to hold the FK relationships
57 *
58 * @var string
59 */
60 static $_links = null;
61 /**
62 * static instance to hold the values that can
63 * be imported
64 *
65 * @var array
66 */
67 static $_import = null;
68 /**
69 * static instance to hold the values that can
70 * be exported
71 *
72 * @var array
73 */
74 static $_export = null;
75 /**
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
78 *
79 * @var boolean
80 */
81 static $_log = false;
82 /**
83 *
84 * @var int unsigned
85 */
86 public $id;
87 /**
88 * The ID of a previous mailing to include/exclude recipients.
89 *
90 * @var int unsigned
91 */
92 public $mailing_id;
93 /**
94 * Are the members of the group included or excluded?.
95 *
96 * @var string
97 */
98 public $group_type;
99 /**
100 * Name of table where item being referenced is stored.
101 *
102 * @var string
103 */
104 public $entity_table;
105 /**
106 * Foreign key to the referenced item.
107 *
108 * @var int unsigned
109 */
110 public $entity_id;
111 /**
112 * The filtering search. custom search id or -1 for civicrm api search
113 *
114 * @var int
115 */
116 public $search_id;
117 /**
118 * The arguments to be sent to the search function
119 *
120 * @var text
121 */
122 public $search_args;
123 /**
124 * class constructor
125 *
126 * @return civicrm_mailing_group
127 */
128 function __construct() {
129 $this->__table = 'civicrm_mailing_group';
130 parent::__construct();
131 }
132 /**
133 * Returns foreign keys and entity references
134 *
135 * @return array
136 * [CRM_Core_Reference_Interface]
137 */
138 static function getReferenceColumns() {
139 if (!self::$_links) {
140 self::$_links = static ::createReferenceColumns(__CLASS__);
141 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'mailing_id', 'civicrm_mailing', 'id');
142 self::$_links[] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
143 }
144 return self::$_links;
145 }
146 /**
147 * Returns all the column names of this table
148 *
149 * @return array
150 */
151 static function &fields() {
152 if (!(self::$_fields)) {
153 self::$_fields = array(
154 'id' => array(
155 'name' => 'id',
156 'type' => CRM_Utils_Type::T_INT,
157 'title' => ts('Mailing Group ID') ,
158 'required' => true,
159 ) ,
160 'mailing_id' => array(
161 'name' => 'mailing_id',
162 'type' => CRM_Utils_Type::T_INT,
163 'title' => ts('Mailing') ,
164 'description' => 'The ID of a previous mailing to include/exclude recipients.',
165 'required' => true,
166 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
167 ) ,
168 'group_type' => array(
169 'name' => 'group_type',
170 'type' => CRM_Utils_Type::T_STRING,
171 'title' => ts('Mailing Group Type') ,
172 'description' => 'Are the members of the group included or excluded?.',
173 'maxlength' => 8,
174 'size' => CRM_Utils_Type::EIGHT,
175 'html' => array(
176 'type' => 'Select',
177 ) ,
178 'pseudoconstant' => array(
179 'callback' => 'CRM_Core_SelectValues::getMailingGroupTypes',
180 )
181 ) ,
182 'entity_table' => array(
183 'name' => 'entity_table',
184 'type' => CRM_Utils_Type::T_STRING,
185 'title' => ts('Mailing Group Entity Table') ,
186 'description' => 'Name of table where item being referenced is stored.',
187 'required' => true,
188 'maxlength' => 64,
189 'size' => CRM_Utils_Type::BIG,
190 ) ,
191 'entity_id' => array(
192 'name' => 'entity_id',
193 'type' => CRM_Utils_Type::T_INT,
194 'title' => ts('Mailing Group Entity') ,
195 'description' => 'Foreign key to the referenced item.',
196 'required' => true,
197 ) ,
198 'search_id' => array(
199 'name' => 'search_id',
200 'type' => CRM_Utils_Type::T_INT,
201 'title' => ts('Mailing Group Search') ,
202 'description' => 'The filtering search. custom search id or -1 for civicrm api search',
203 ) ,
204 'search_args' => array(
205 'name' => 'search_args',
206 'type' => CRM_Utils_Type::T_TEXT,
207 'title' => ts('Mailing Group Search Arguments') ,
208 'description' => 'The arguments to be sent to the search function',
209 ) ,
210 );
211 }
212 return self::$_fields;
213 }
214 /**
215 * Returns an array containing, for each field, the arary key used for that
216 * field in self::$_fields.
217 *
218 * @return array
219 */
220 static function &fieldKeys() {
221 if (!(self::$_fieldKeys)) {
222 self::$_fieldKeys = array(
223 'id' => 'id',
224 'mailing_id' => 'mailing_id',
225 'group_type' => 'group_type',
226 'entity_table' => 'entity_table',
227 'entity_id' => 'entity_id',
228 'search_id' => 'search_id',
229 'search_args' => 'search_args',
230 );
231 }
232 return self::$_fieldKeys;
233 }
234 /**
235 * Returns the names of this table
236 *
237 * @return string
238 */
239 static function getTableName() {
240 return self::$_tableName;
241 }
242 /**
243 * Returns if this table needs to be logged
244 *
245 * @return boolean
246 */
247 function getLog() {
248 return self::$_log;
249 }
250 /**
251 * Returns the list of fields that can be imported
252 *
253 * @param bool $prefix
254 *
255 * @return array
256 */
257 static function &import($prefix = false) {
258 if (!(self::$_import)) {
259 self::$_import = array();
260 $fields = self::fields();
261 foreach($fields as $name => $field) {
262 if (CRM_Utils_Array::value('import', $field)) {
263 if ($prefix) {
264 self::$_import['mailing_group'] = & $fields[$name];
265 } else {
266 self::$_import[$name] = & $fields[$name];
267 }
268 }
269 }
270 }
271 return self::$_import;
272 }
273 /**
274 * Returns the list of fields that can be exported
275 *
276 * @param bool $prefix
277 *
278 * @return array
279 */
280 static function &export($prefix = false) {
281 if (!(self::$_export)) {
282 self::$_export = array();
283 $fields = self::fields();
284 foreach($fields as $name => $field) {
285 if (CRM_Utils_Array::value('export', $field)) {
286 if ($prefix) {
287 self::$_export['mailing_group'] = & $fields[$name];
288 } else {
289 self::$_export[$name] = & $fields[$name];
290 }
291 }
292 }
293 }
294 return self::$_export;
295 }
296 }