5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/MailingGroup.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:1869c2f625f9a35820d1342217bd7feb)
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 localized title of this entity.
89 public static function getEntityTitle() {
90 return ts('Mailing Groups');
94 * Returns foreign keys and entity references.
97 * [CRM_Core_Reference_Interface]
99 public static function getReferenceColumns() {
100 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
101 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
102 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'mailing_id', 'civicrm_mailing', 'id');
103 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
104 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
106 return Civi
::$statics[__CLASS__
]['links'];
110 * Returns all the column names of this table
114 public static function &fields() {
115 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
116 Civi
::$statics[__CLASS__
]['fields'] = [
119 'type' => CRM_Utils_Type
::T_INT
,
120 'title' => ts('Mailing Group ID'),
122 'where' => 'civicrm_mailing_group.id',
123 'table_name' => 'civicrm_mailing_group',
124 'entity' => 'MailingGroup',
125 'bao' => 'CRM_Mailing_DAO_MailingGroup',
130 'name' => 'mailing_id',
131 'type' => CRM_Utils_Type
::T_INT
,
132 'title' => ts('Mailing'),
133 'description' => ts('The ID of a previous mailing to include/exclude recipients.'),
135 'where' => 'civicrm_mailing_group.mailing_id',
136 'table_name' => 'civicrm_mailing_group',
137 'entity' => 'MailingGroup',
138 'bao' => 'CRM_Mailing_DAO_MailingGroup',
140 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
144 'name' => 'group_type',
145 'type' => CRM_Utils_Type
::T_STRING
,
146 'title' => ts('Mailing Group Type'),
147 'description' => ts('Are the members of the group included or excluded?.'),
149 'size' => CRM_Utils_Type
::EIGHT
,
150 'where' => 'civicrm_mailing_group.group_type',
151 'table_name' => 'civicrm_mailing_group',
152 'entity' => 'MailingGroup',
153 'bao' => 'CRM_Mailing_DAO_MailingGroup',
158 'pseudoconstant' => [
159 'callback' => 'CRM_Core_SelectValues::getMailingGroupTypes',
164 'name' => 'entity_table',
165 'type' => CRM_Utils_Type
::T_STRING
,
166 'title' => ts('Mailing Group Entity Table'),
167 'description' => ts('Name of table where item being referenced is stored.'),
170 'size' => CRM_Utils_Type
::BIG
,
171 'where' => 'civicrm_mailing_group.entity_table',
172 'table_name' => 'civicrm_mailing_group',
173 'entity' => 'MailingGroup',
174 'bao' => 'CRM_Mailing_DAO_MailingGroup',
176 'pseudoconstant' => [
177 'callback' => 'CRM_Mailing_BAO_Mailing::mailingGroupEntityTables',
182 'name' => 'entity_id',
183 'type' => CRM_Utils_Type
::T_INT
,
184 'title' => ts('Mailing Group Entity'),
185 'description' => ts('Foreign key to the referenced item.'),
187 'where' => 'civicrm_mailing_group.entity_id',
188 'table_name' => 'civicrm_mailing_group',
189 'entity' => 'MailingGroup',
190 'bao' => 'CRM_Mailing_DAO_MailingGroup',
195 'name' => 'search_id',
196 'type' => CRM_Utils_Type
::T_INT
,
197 'title' => ts('Mailing Group Search'),
198 'description' => ts('The filtering search. custom search id or -1 for civicrm api search'),
199 'where' => 'civicrm_mailing_group.search_id',
200 'table_name' => 'civicrm_mailing_group',
201 'entity' => 'MailingGroup',
202 'bao' => 'CRM_Mailing_DAO_MailingGroup',
207 'name' => 'search_args',
208 'type' => CRM_Utils_Type
::T_TEXT
,
209 'title' => ts('Mailing Group Search Arguments'),
210 'description' => ts('The arguments to be sent to the search function'),
211 'where' => 'civicrm_mailing_group.search_args',
212 'table_name' => 'civicrm_mailing_group',
213 'entity' => 'MailingGroup',
214 'bao' => 'CRM_Mailing_DAO_MailingGroup',
219 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
221 return Civi
::$statics[__CLASS__
]['fields'];
225 * Return a mapping from field-name to the corresponding key (as used in fields()).
228 * Array(string $name => string $uniqueName).
230 public static function &fieldKeys() {
231 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
232 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
234 return Civi
::$statics[__CLASS__
]['fieldKeys'];
238 * Returns the names of this table
242 public static function getTableName() {
243 return self
::$_tableName;
247 * Returns if this table needs to be logged
251 public function getLog() {
256 * Returns the list of fields that can be imported
258 * @param bool $prefix
262 public static function &import($prefix = FALSE) {
263 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_group', $prefix, []);
268 * Returns the list of fields that can be exported
270 * @param bool $prefix
274 public static function &export($prefix = FALSE) {
275 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_group', $prefix, []);
280 * Returns the list of indices
282 * @param bool $localize
286 public static function indices($localize = TRUE) {
288 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;