3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
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-2017
31 * Generated from xml/schema/CRM/Core/Email.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:33bf5e19c3136f4860d3d078a3fbd68d)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Core_DAO_Email constructor.
40 class CRM_Core_DAO_Email
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_email';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
66 * Which Location does this email belong to.
70 public $location_type_id;
78 * Is this the primary?
84 * Is this the billing?
90 * Is this address on bounce hold?
96 * Is this address for bulk mail ?
102 * When the address went on bounce hold
108 * When the address bounce status was last reset
114 * Text formatted signature for the email.
118 public $signature_text;
120 * HTML formatted signature for the email.
124 public $signature_html;
128 function __construct() {
129 $this->__table
= 'civicrm_email';
130 parent
::__construct();
133 * Returns foreign keys and entity references.
136 * [CRM_Core_Reference_Interface]
138 static function getReferenceColumns() {
139 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
140 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
141 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
142 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
144 return Civi
::$statics[__CLASS__
]['links'];
147 * Returns all the column names of this table
151 static function &fields() {
152 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
153 Civi
::$statics[__CLASS__
]['fields'] = array(
156 'type' => CRM_Utils_Type
::T_INT
,
157 'title' => ts('Email ID') ,
158 'description' => 'Unique Email ID',
160 'table_name' => 'civicrm_email',
162 'bao' => 'CRM_Core_BAO_Email',
165 'contact_id' => array(
166 'name' => 'contact_id',
167 'type' => CRM_Utils_Type
::T_INT
,
168 'title' => ts('Email Contact') ,
169 'description' => 'FK to Contact ID',
170 'table_name' => 'civicrm_email',
172 'bao' => 'CRM_Core_BAO_Email',
174 'FKClassName' => 'CRM_Contact_DAO_Contact',
176 'location_type_id' => array(
177 'name' => 'location_type_id',
178 'type' => CRM_Utils_Type
::T_INT
,
179 'title' => ts('Email Location Type') ,
180 'description' => 'Which Location does this email belong to.',
181 'table_name' => 'civicrm_email',
183 'bao' => 'CRM_Core_BAO_Email',
188 'pseudoconstant' => array(
189 'table' => 'civicrm_location_type',
191 'labelColumn' => 'display_name',
196 'type' => CRM_Utils_Type
::T_STRING
,
197 'title' => ts('Email') ,
198 'description' => 'Email address',
202 'where' => 'civicrm_email.email',
203 'headerPattern' => '/e.?mail/i',
204 'dataPattern' => '/^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/',
207 'table_name' => 'civicrm_email',
209 'bao' => 'CRM_Core_BAO_Email',
215 'is_primary' => array(
216 'name' => 'is_primary',
217 'type' => CRM_Utils_Type
::T_BOOLEAN
,
218 'title' => ts('Is Primary email') ,
219 'description' => 'Is this the primary?',
220 'table_name' => 'civicrm_email',
222 'bao' => 'CRM_Core_BAO_Email',
225 'is_billing' => array(
226 'name' => 'is_billing',
227 'type' => CRM_Utils_Type
::T_BOOLEAN
,
228 'title' => ts('Is Billing Email?') ,
229 'description' => 'Is this the billing?',
230 'table_name' => 'civicrm_email',
232 'bao' => 'CRM_Core_BAO_Email',
237 'type' => CRM_Utils_Type
::T_BOOLEAN
,
238 'title' => ts('On Hold') ,
239 'description' => 'Is this address on bounce hold?',
242 'where' => 'civicrm_email.on_hold',
243 'headerPattern' => '',
245 'table_name' => 'civicrm_email',
247 'bao' => 'CRM_Core_BAO_Email',
250 'type' => 'CheckBox',
253 'is_bulkmail' => array(
254 'name' => 'is_bulkmail',
255 'type' => CRM_Utils_Type
::T_BOOLEAN
,
256 'title' => ts('Use for Bulk Mail') ,
257 'description' => 'Is this address for bulk mail ?',
260 'where' => 'civicrm_email.is_bulkmail',
261 'headerPattern' => '',
263 'table_name' => 'civicrm_email',
265 'bao' => 'CRM_Core_BAO_Email',
268 'hold_date' => array(
269 'name' => 'hold_date',
270 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
271 'title' => ts('Hold Date') ,
272 'description' => 'When the address went on bounce hold',
273 'table_name' => 'civicrm_email',
275 'bao' => 'CRM_Core_BAO_Email',
278 'reset_date' => array(
279 'name' => 'reset_date',
280 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
281 'title' => ts('Reset Date') ,
282 'description' => 'When the address bounce status was last reset',
283 'table_name' => 'civicrm_email',
285 'bao' => 'CRM_Core_BAO_Email',
288 'signature_text' => array(
289 'name' => 'signature_text',
290 'type' => CRM_Utils_Type
::T_TEXT
,
291 'title' => ts('Signature Text') ,
292 'description' => 'Text formatted signature for the email.',
294 'where' => 'civicrm_email.signature_text',
295 'headerPattern' => '',
299 'table_name' => 'civicrm_email',
301 'bao' => 'CRM_Core_BAO_Email',
304 'signature_html' => array(
305 'name' => 'signature_html',
306 'type' => CRM_Utils_Type
::T_TEXT
,
307 'title' => ts('Signature Html') ,
308 'description' => 'HTML formatted signature for the email.',
310 'where' => 'civicrm_email.signature_html',
311 'headerPattern' => '',
315 'table_name' => 'civicrm_email',
317 'bao' => 'CRM_Core_BAO_Email',
321 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
323 return Civi
::$statics[__CLASS__
]['fields'];
326 * Return a mapping from field-name to the corresponding key (as used in fields()).
329 * Array(string $name => string $uniqueName).
331 static function &fieldKeys() {
332 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
333 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
335 return Civi
::$statics[__CLASS__
]['fieldKeys'];
338 * Returns the names of this table
342 static function getTableName() {
343 return self
::$_tableName;
346 * Returns if this table needs to be logged
354 * Returns the list of fields that can be imported
356 * @param bool $prefix
360 static function &import($prefix = false) {
361 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'email', $prefix, array());
365 * Returns the list of fields that can be exported
367 * @param bool $prefix
371 static function &export($prefix = false) {
372 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'email', $prefix, array());