Regenerate DAO files
[civicrm-core.git] / CRM / Mailing / DAO / Recipients.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Mailing/Recipients.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:ebd2ec177861f8f82a4bc6bc8b33fd9b)
10 */
11
12 /**
13 * Database access object for the Recipients entity.
14 */
15 class CRM_Mailing_DAO_Recipients extends CRM_Core_DAO {
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '';
18
19 /**
20 * Static instance to hold the table name.
21 *
22 * @var string
23 */
24 public static $_tableName = 'civicrm_mailing_recipients';
25
26 /**
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
28 *
29 * @var bool
30 */
31 public static $_log = FALSE;
32
33 /**
34 * @var int
35 */
36 public $id;
37
38 /**
39 * The ID of the mailing this Job will send.
40 *
41 * @var int
42 */
43 public $mailing_id;
44
45 /**
46 * FK to Contact
47 *
48 * @var int
49 */
50 public $contact_id;
51
52 /**
53 * FK to Email
54 *
55 * @var int
56 */
57 public $email_id;
58
59 /**
60 * FK to Phone
61 *
62 * @var int
63 */
64 public $phone_id;
65
66 /**
67 * Class constructor.
68 */
69 public function __construct() {
70 $this->__table = 'civicrm_mailing_recipients';
71 parent::__construct();
72 }
73
74 /**
75 * Returns localized title of this entity.
76 */
77 public static function getEntityTitle() {
78 return ts('Recipientses');
79 }
80
81 /**
82 * Returns foreign keys and entity references.
83 *
84 * @return array
85 * [CRM_Core_Reference_Interface]
86 */
87 public static function getReferenceColumns() {
88 if (!isset(Civi::$statics[__CLASS__]['links'])) {
89 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
90 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'mailing_id', 'civicrm_mailing', 'id');
91 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id');
92 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'email_id', 'civicrm_email', 'id');
93 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'phone_id', 'civicrm_phone', 'id');
94 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
95 }
96 return Civi::$statics[__CLASS__]['links'];
97 }
98
99 /**
100 * Returns all the column names of this table
101 *
102 * @return array
103 */
104 public static function &fields() {
105 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
106 Civi::$statics[__CLASS__]['fields'] = [
107 'id' => [
108 'name' => 'id',
109 'type' => CRM_Utils_Type::T_INT,
110 'title' => ts('Mailing Recipients ID'),
111 'required' => TRUE,
112 'where' => 'civicrm_mailing_recipients.id',
113 'table_name' => 'civicrm_mailing_recipients',
114 'entity' => 'Recipients',
115 'bao' => 'CRM_Mailing_BAO_Recipients',
116 'localizable' => 0,
117 'add' => NULL,
118 ],
119 'mailing_id' => [
120 'name' => 'mailing_id',
121 'type' => CRM_Utils_Type::T_INT,
122 'title' => ts('Mailing'),
123 'description' => ts('The ID of the mailing this Job will send.'),
124 'required' => TRUE,
125 'where' => 'civicrm_mailing_recipients.mailing_id',
126 'table_name' => 'civicrm_mailing_recipients',
127 'entity' => 'Recipients',
128 'bao' => 'CRM_Mailing_BAO_Recipients',
129 'localizable' => 0,
130 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
131 'add' => NULL,
132 ],
133 'contact_id' => [
134 'name' => 'contact_id',
135 'type' => CRM_Utils_Type::T_INT,
136 'title' => ts('Mailing Recipient'),
137 'description' => ts('FK to Contact'),
138 'required' => TRUE,
139 'where' => 'civicrm_mailing_recipients.contact_id',
140 'table_name' => 'civicrm_mailing_recipients',
141 'entity' => 'Recipients',
142 'bao' => 'CRM_Mailing_BAO_Recipients',
143 'localizable' => 0,
144 'FKClassName' => 'CRM_Contact_DAO_Contact',
145 'add' => NULL,
146 ],
147 'email_id' => [
148 'name' => 'email_id',
149 'type' => CRM_Utils_Type::T_INT,
150 'title' => ts('Recipient Email'),
151 'description' => ts('FK to Email'),
152 'where' => 'civicrm_mailing_recipients.email_id',
153 'default' => 'NULL',
154 'table_name' => 'civicrm_mailing_recipients',
155 'entity' => 'Recipients',
156 'bao' => 'CRM_Mailing_BAO_Recipients',
157 'localizable' => 0,
158 'FKClassName' => 'CRM_Core_DAO_Email',
159 'add' => NULL,
160 ],
161 'phone_id' => [
162 'name' => 'phone_id',
163 'type' => CRM_Utils_Type::T_INT,
164 'title' => ts('Recipient Phone'),
165 'description' => ts('FK to Phone'),
166 'where' => 'civicrm_mailing_recipients.phone_id',
167 'default' => 'NULL',
168 'table_name' => 'civicrm_mailing_recipients',
169 'entity' => 'Recipients',
170 'bao' => 'CRM_Mailing_BAO_Recipients',
171 'localizable' => 0,
172 'FKClassName' => 'CRM_Core_DAO_Phone',
173 'add' => NULL,
174 ],
175 ];
176 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
177 }
178 return Civi::$statics[__CLASS__]['fields'];
179 }
180
181 /**
182 * Return a mapping from field-name to the corresponding key (as used in fields()).
183 *
184 * @return array
185 * Array(string $name => string $uniqueName).
186 */
187 public static function &fieldKeys() {
188 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
189 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
190 }
191 return Civi::$statics[__CLASS__]['fieldKeys'];
192 }
193
194 /**
195 * Returns the names of this table
196 *
197 * @return string
198 */
199 public static function getTableName() {
200 return self::$_tableName;
201 }
202
203 /**
204 * Returns if this table needs to be logged
205 *
206 * @return bool
207 */
208 public function getLog() {
209 return self::$_log;
210 }
211
212 /**
213 * Returns the list of fields that can be imported
214 *
215 * @param bool $prefix
216 *
217 * @return array
218 */
219 public static function &import($prefix = FALSE) {
220 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_recipients', $prefix, []);
221 return $r;
222 }
223
224 /**
225 * Returns the list of fields that can be exported
226 *
227 * @param bool $prefix
228 *
229 * @return array
230 */
231 public static function &export($prefix = FALSE) {
232 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_recipients', $prefix, []);
233 return $r;
234 }
235
236 /**
237 * Returns the list of indices
238 *
239 * @param bool $localize
240 *
241 * @return array
242 */
243 public static function indices($localize = TRUE) {
244 $indices = [];
245 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
246 }
247
248 }