3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
31 * Generated from xml/schema/CRM/Core/Email.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:988b68b07a90ff903001c8f68b2e2545)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_Email
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_email';
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
64 * Which Location does this email belong to.
68 public $location_type_id;
76 * Is this the primary?
82 * Is this the billing?
88 * Is this address on bounce hold?
94 * Is this address for bulk mail ?
100 * When the address went on bounce hold
106 * When the address bounce status was last reset
112 * Text formatted signature for the email.
116 public $signature_text;
118 * HTML formatted signature for the email.
122 public $signature_html;
126 * @return civicrm_email
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',
161 'contact_id' => array(
162 'name' => 'contact_id',
163 'type' => CRM_Utils_Type
::T_INT
,
164 'title' => ts('Email Contact') ,
165 'description' => 'FK to Contact ID',
166 'FKClassName' => 'CRM_Contact_DAO_Contact',
168 'location_type_id' => array(
169 'name' => 'location_type_id',
170 'type' => CRM_Utils_Type
::T_INT
,
171 'title' => ts('Email Location Type') ,
172 'description' => 'Which Location does this email belong to.',
176 'pseudoconstant' => array(
177 'table' => 'civicrm_location_type',
179 'labelColumn' => 'display_name',
184 'type' => CRM_Utils_Type
::T_STRING
,
185 'title' => ts('Email') ,
186 'description' => 'Email address',
190 'where' => 'civicrm_email.email',
191 'headerPattern' => '/e.?mail/i',
192 '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]$/',
199 'is_primary' => array(
200 'name' => 'is_primary',
201 'type' => CRM_Utils_Type
::T_BOOLEAN
,
202 'title' => ts('Is Primary email') ,
203 'description' => 'Is this the primary?',
205 'is_billing' => array(
206 'name' => 'is_billing',
207 'type' => CRM_Utils_Type
::T_BOOLEAN
,
208 'title' => ts('Is Billing Email?') ,
209 'description' => 'Is this the billing?',
213 'type' => CRM_Utils_Type
::T_BOOLEAN
,
214 'title' => ts('On Hold') ,
215 'description' => 'Is this address on bounce hold?',
218 'where' => 'civicrm_email.on_hold',
219 'headerPattern' => '',
222 'type' => 'CheckBox',
225 'is_bulkmail' => array(
226 'name' => 'is_bulkmail',
227 'type' => CRM_Utils_Type
::T_BOOLEAN
,
228 'title' => ts('Use for Bulk Mail') ,
229 'description' => 'Is this address for bulk mail ?',
232 'where' => 'civicrm_email.is_bulkmail',
233 'headerPattern' => '',
236 'hold_date' => array(
237 'name' => 'hold_date',
238 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
239 'title' => ts('Hold Date') ,
240 'description' => 'When the address went on bounce hold',
242 'reset_date' => array(
243 'name' => 'reset_date',
244 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
245 'title' => ts('Reset Date') ,
246 'description' => 'When the address bounce status was last reset',
248 'signature_text' => array(
249 'name' => 'signature_text',
250 'type' => CRM_Utils_Type
::T_TEXT
,
251 'title' => ts('Signature Text') ,
252 'description' => 'Text formatted signature for the email.',
254 'where' => 'civicrm_email.signature_text',
255 'headerPattern' => '',
260 'signature_html' => array(
261 'name' => 'signature_html',
262 'type' => CRM_Utils_Type
::T_TEXT
,
263 'title' => ts('Signature Html') ,
264 'description' => 'HTML formatted signature for the email.',
266 'where' => 'civicrm_email.signature_html',
267 'headerPattern' => '',
273 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
275 return Civi
::$statics[__CLASS__
]['fields'];
278 * Return a mapping from field-name to the corresponding key (as used in fields()).
281 * Array(string $name => string $uniqueName).
283 static function &fieldKeys() {
284 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
285 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
287 return Civi
::$statics[__CLASS__
]['fieldKeys'];
290 * Returns the names of this table
294 static function getTableName() {
295 return self
::$_tableName;
298 * Returns if this table needs to be logged
306 * Returns the list of fields that can be imported
308 * @param bool $prefix
312 static function &import($prefix = false) {
313 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'email', $prefix, array());
317 * Returns the list of fields that can be exported
319 * @param bool $prefix
323 static function &export($prefix = false) {
324 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'email', $prefix, array());