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/Mailing/Recipients.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:7186783b32725a9ba0fd6b6ea995a69a)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Mailing_DAO_Recipients
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_mailing_recipients';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the keys used in $_fields for each field.
55 static $_fieldKeys = null;
57 * static instance to hold the FK relationships
61 static $_links = null;
63 * static instance to hold the values that can
68 static $_import = null;
70 * static instance to hold the values that can
75 static $_export = null;
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
89 * The ID of the mailing this Job will send.
115 * @return civicrm_mailing_recipients
117 function __construct() {
118 $this->__table
= 'civicrm_mailing_recipients';
119 parent
::__construct();
122 * Returns foreign keys and entity references
125 * [CRM_Core_Reference_Interface]
127 static function getReferenceColumns() {
128 if (!self
::$_links) {
129 self
::$_links = static ::createReferenceColumns(__CLASS__
);
130 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'mailing_id', 'civicrm_mailing', 'id');
131 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
132 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'email_id', 'civicrm_email', 'id');
133 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'phone_id', 'civicrm_phone', 'id');
135 return self
::$_links;
138 * Returns all the column names of this table
142 static function &fields() {
143 if (!(self
::$_fields)) {
144 self
::$_fields = array(
147 'type' => CRM_Utils_Type
::T_INT
,
148 'title' => ts('Mailing Recipients ID') ,
151 'mailing_id' => array(
152 'name' => 'mailing_id',
153 'type' => CRM_Utils_Type
::T_INT
,
154 'title' => ts('Mailing') ,
155 'description' => 'The ID of the mailing this Job will send.',
157 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
159 'contact_id' => array(
160 'name' => 'contact_id',
161 'type' => CRM_Utils_Type
::T_INT
,
162 'title' => ts('Mailing Recipient') ,
163 'description' => 'FK to Contact',
165 'FKClassName' => 'CRM_Contact_DAO_Contact',
168 'name' => 'email_id',
169 'type' => CRM_Utils_Type
::T_INT
,
170 'title' => ts('Recipient Email') ,
171 'description' => 'FK to Email',
173 'FKClassName' => 'CRM_Core_DAO_Email',
176 'name' => 'phone_id',
177 'type' => CRM_Utils_Type
::T_INT
,
178 'title' => ts('Recipient Phone') ,
179 'description' => 'FK to Phone',
181 'FKClassName' => 'CRM_Core_DAO_Phone',
185 return self
::$_fields;
188 * Returns an array containing, for each field, the arary key used for that
189 * field in self::$_fields.
193 static function &fieldKeys() {
194 if (!(self
::$_fieldKeys)) {
195 self
::$_fieldKeys = array(
197 'mailing_id' => 'mailing_id',
198 'contact_id' => 'contact_id',
199 'email_id' => 'email_id',
200 'phone_id' => 'phone_id',
203 return self
::$_fieldKeys;
206 * Returns the names of this table
210 static function getTableName() {
211 return self
::$_tableName;
214 * Returns if this table needs to be logged
222 * Returns the list of fields that can be imported
224 * @param bool $prefix
228 static function &import($prefix = false) {
229 if (!(self
::$_import)) {
230 self
::$_import = array();
231 $fields = self
::fields();
232 foreach($fields as $name => $field) {
233 if (CRM_Utils_Array
::value('import', $field)) {
235 self
::$_import['mailing_recipients'] = & $fields[$name];
237 self
::$_import[$name] = & $fields[$name];
242 return self
::$_import;
245 * Returns the list of fields that can be exported
247 * @param bool $prefix
251 static function &export($prefix = false) {
252 if (!(self
::$_export)) {
253 self
::$_export = array();
254 $fields = self
::fields();
255 foreach($fields as $name => $field) {
256 if (CRM_Utils_Array
::value('export', $field)) {
258 self
::$_export['mailing_recipients'] = & $fields[$name];
260 self
::$_export[$name] = & $fields[$name];
265 return self
::$_export;