5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Mailing/MailingGroup.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:f39d14e245f10652e2fcea603ebc7610)
13 * Database access object for the MailingGroup entity.
15 class CRM_Mailing_DAO_MailingGroup
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_mailing_group';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
37 * The ID of a previous mailing to include/exclude recipients.
44 * Are the members of the group included or excluded?.
51 * Name of table where item being referenced is stored.
58 * Foreign key to the referenced item.
65 * The filtering search. custom search id or -1 for civicrm api search
72 * The arguments to be sent to the search function
81 public function __construct() {
82 $this->__table
= 'civicrm_mailing_group';
83 parent
::__construct();
87 * Returns foreign keys and entity references.
90 * [CRM_Core_Reference_Interface]
92 public static function getReferenceColumns() {
93 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
94 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
95 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'mailing_id', 'civicrm_mailing', 'id');
96 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
97 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
99 return Civi
::$statics[__CLASS__
]['links'];
103 * Returns all the column names of this table
107 public static function &fields() {
108 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
109 Civi
::$statics[__CLASS__
]['fields'] = [
112 'type' => CRM_Utils_Type
::T_INT
,
113 'title' => ts('Mailing Group ID'),
115 'table_name' => 'civicrm_mailing_group',
116 'entity' => 'MailingGroup',
117 'bao' => 'CRM_Mailing_DAO_MailingGroup',
121 'name' => 'mailing_id',
122 'type' => CRM_Utils_Type
::T_INT
,
123 'title' => ts('Mailing'),
124 'description' => ts('The ID of a previous mailing to include/exclude recipients.'),
126 'table_name' => 'civicrm_mailing_group',
127 'entity' => 'MailingGroup',
128 'bao' => 'CRM_Mailing_DAO_MailingGroup',
130 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
133 'name' => 'group_type',
134 'type' => CRM_Utils_Type
::T_STRING
,
135 'title' => ts('Mailing Group Type'),
136 'description' => ts('Are the members of the group included or excluded?.'),
138 'size' => CRM_Utils_Type
::EIGHT
,
139 'table_name' => 'civicrm_mailing_group',
140 'entity' => 'MailingGroup',
141 'bao' => 'CRM_Mailing_DAO_MailingGroup',
146 'pseudoconstant' => [
147 'callback' => 'CRM_Core_SelectValues::getMailingGroupTypes',
151 'name' => 'entity_table',
152 'type' => CRM_Utils_Type
::T_STRING
,
153 'title' => ts('Mailing Group Entity Table'),
154 'description' => ts('Name of table where item being referenced is stored.'),
157 'size' => CRM_Utils_Type
::BIG
,
158 'table_name' => 'civicrm_mailing_group',
159 'entity' => 'MailingGroup',
160 'bao' => 'CRM_Mailing_DAO_MailingGroup',
162 'pseudoconstant' => [
163 'callback' => 'CRM_Mailing_BAO_Mailing::mailingGroupEntityTables',
167 'name' => 'entity_id',
168 'type' => CRM_Utils_Type
::T_INT
,
169 'title' => ts('Mailing Group Entity'),
170 'description' => ts('Foreign key to the referenced item.'),
172 'table_name' => 'civicrm_mailing_group',
173 'entity' => 'MailingGroup',
174 'bao' => 'CRM_Mailing_DAO_MailingGroup',
178 'name' => 'search_id',
179 'type' => CRM_Utils_Type
::T_INT
,
180 'title' => ts('Mailing Group Search'),
181 'description' => ts('The filtering search. custom search id or -1 for civicrm api search'),
182 'table_name' => 'civicrm_mailing_group',
183 'entity' => 'MailingGroup',
184 'bao' => 'CRM_Mailing_DAO_MailingGroup',
188 'name' => 'search_args',
189 'type' => CRM_Utils_Type
::T_TEXT
,
190 'title' => ts('Mailing Group Search Arguments'),
191 'description' => ts('The arguments to be sent to the search function'),
192 'table_name' => 'civicrm_mailing_group',
193 'entity' => 'MailingGroup',
194 'bao' => 'CRM_Mailing_DAO_MailingGroup',
198 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
200 return Civi
::$statics[__CLASS__
]['fields'];
204 * Return a mapping from field-name to the corresponding key (as used in fields()).
207 * Array(string $name => string $uniqueName).
209 public static function &fieldKeys() {
210 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
211 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
213 return Civi
::$statics[__CLASS__
]['fieldKeys'];
217 * Returns the names of this table
221 public static function getTableName() {
222 return self
::$_tableName;
226 * Returns if this table needs to be logged
230 public function getLog() {
235 * Returns the list of fields that can be imported
237 * @param bool $prefix
241 public static function &import($prefix = FALSE) {
242 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_group', $prefix, []);
247 * Returns the list of fields that can be exported
249 * @param bool $prefix
253 public static function &export($prefix = FALSE) {
254 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_group', $prefix, []);
259 * Returns the list of indices
261 * @param bool $localize
265 public static function indices($localize = TRUE) {
267 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;