5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/Recipients.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:ebd2ec177861f8f82a4bc6bc8b33fd9b)
13 * Database access object for the Recipients entity.
15 class CRM_Mailing_DAO_Recipients
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_mailing_recipients';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
39 * The ID of the mailing this Job will send.
69 public function __construct() {
70 $this->__table
= 'civicrm_mailing_recipients';
71 parent
::__construct();
75 * Returns localized title of this entity.
77 public static function getEntityTitle() {
78 return ts('Recipientses');
82 * Returns foreign keys and entity references.
85 * [CRM_Core_Reference_Interface]
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']);
96 return Civi
::$statics[__CLASS__
]['links'];
100 * Returns all the column names of this table
104 public static function &fields() {
105 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
106 Civi
::$statics[__CLASS__
]['fields'] = [
109 'type' => CRM_Utils_Type
::T_INT
,
110 'title' => ts('Mailing Recipients ID'),
112 'where' => 'civicrm_mailing_recipients.id',
113 'table_name' => 'civicrm_mailing_recipients',
114 'entity' => 'Recipients',
115 'bao' => 'CRM_Mailing_BAO_Recipients',
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.'),
125 'where' => 'civicrm_mailing_recipients.mailing_id',
126 'table_name' => 'civicrm_mailing_recipients',
127 'entity' => 'Recipients',
128 'bao' => 'CRM_Mailing_BAO_Recipients',
130 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
134 'name' => 'contact_id',
135 'type' => CRM_Utils_Type
::T_INT
,
136 'title' => ts('Mailing Recipient'),
137 'description' => ts('FK to Contact'),
139 'where' => 'civicrm_mailing_recipients.contact_id',
140 'table_name' => 'civicrm_mailing_recipients',
141 'entity' => 'Recipients',
142 'bao' => 'CRM_Mailing_BAO_Recipients',
144 'FKClassName' => 'CRM_Contact_DAO_Contact',
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',
154 'table_name' => 'civicrm_mailing_recipients',
155 'entity' => 'Recipients',
156 'bao' => 'CRM_Mailing_BAO_Recipients',
158 'FKClassName' => 'CRM_Core_DAO_Email',
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',
168 'table_name' => 'civicrm_mailing_recipients',
169 'entity' => 'Recipients',
170 'bao' => 'CRM_Mailing_BAO_Recipients',
172 'FKClassName' => 'CRM_Core_DAO_Phone',
176 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
178 return Civi
::$statics[__CLASS__
]['fields'];
182 * Return a mapping from field-name to the corresponding key (as used in fields()).
185 * Array(string $name => string $uniqueName).
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()));
191 return Civi
::$statics[__CLASS__
]['fieldKeys'];
195 * Returns the names of this table
199 public static function getTableName() {
200 return self
::$_tableName;
204 * Returns if this table needs to be logged
208 public function getLog() {
213 * Returns the list of fields that can be imported
215 * @param bool $prefix
219 public static function &import($prefix = FALSE) {
220 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_recipients', $prefix, []);
225 * Returns the list of fields that can be exported
227 * @param bool $prefix
231 public static function &export($prefix = FALSE) {
232 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_recipients', $prefix, []);
237 * Returns the list of indices
239 * @param bool $localize
243 public static function indices($localize = TRUE) {
245 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;