3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2015
31 * Generated from xml/schema/CRM/Mailing/MailingGroup.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Mailing_DAO_MailingGroup
extends CRM_Core_DAO
{
38 * static instance to hold the table name
42 static $_tableName = 'civicrm_mailing_group';
44 * static instance to hold the field values
48 static $_fields = null;
50 * static instance to hold the keys used in $_fields for each field.
54 static $_fieldKeys = null;
56 * static instance to hold the FK relationships
60 static $_links = null;
62 * static instance to hold the values that can
67 static $_import = null;
69 * static instance to hold the values that can
74 static $_export = null;
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
88 * The ID of a previous mailing to include/exclude recipients.
94 * Are the members of the group included or excluded?.
100 * Name of table where item being referenced is stored.
104 public $entity_table;
106 * Foreign key to the referenced item.
112 * The filtering search. custom search id or -1 for civicrm api search
118 * The arguments to be sent to the search function
126 * @return civicrm_mailing_group
128 function __construct() {
129 $this->__table
= 'civicrm_mailing_group';
130 parent
::__construct();
133 * Returns foreign keys and entity references
136 * [CRM_Core_Reference_Interface]
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');
144 return self
::$_links;
147 * Returns all the column names of this table
151 static function &fields() {
152 if (!(self
::$_fields)) {
153 self
::$_fields = array(
156 'type' => CRM_Utils_Type
::T_INT
,
157 'title' => ts('Mailing Group ID') ,
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.',
166 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
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?.',
174 'size' => CRM_Utils_Type
::EIGHT
,
178 'pseudoconstant' => array(
179 'callback' => 'CRM_Core_SelectValues::getMailingGroupTypes',
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.',
189 'size' => CRM_Utils_Type
::BIG
,
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.',
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',
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',
212 return self
::$_fields;
215 * Returns an array containing, for each field, the arary key used for that
216 * field in self::$_fields.
220 static function &fieldKeys() {
221 if (!(self
::$_fieldKeys)) {
222 self
::$_fieldKeys = array(
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',
232 return self
::$_fieldKeys;
235 * Returns the names of this table
239 static function getTableName() {
240 return self
::$_tableName;
243 * Returns if this table needs to be logged
251 * Returns the list of fields that can be imported
253 * @param bool $prefix
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)) {
264 self
::$_import['mailing_group'] = & $fields[$name];
266 self
::$_import[$name] = & $fields[$name];
271 return self
::$_import;
274 * Returns the list of fields that can be exported
276 * @param bool $prefix
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)) {
287 self
::$_export['mailing_group'] = & $fields[$name];
289 self
::$_export[$name] = & $fields[$name];
294 return self
::$_export;