xml/templates/dao.tpl - Simplify fieldKeys()
[civicrm-core.git] / CRM / Mailing / Event / DAO / Confirm.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
6| Copyright CiviCRM LLC (c) 2004-2016 |
7+--------------------------------------------------------------------+
8| This file is a part of CiviCRM. |
9| |
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. |
13| |
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. |
18| |
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+--------------------------------------------------------------------+
26*/
27/**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2016
30 *
31 * Generated from xml/schema/CRM/Mailing/Event/Confirm.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
437fafcf 33 * (GenCodeChecksum:c6e6b02a3a8b126eaee7bf4b58b8261e)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
37class CRM_Mailing_Event_DAO_Confirm extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_mailing_event_confirm';
44 /**
45 * static instance to hold the field values
46 *
47 * @var array
48 */
49 static $_fields = null;
50 /**
51 * static instance to hold the keys used in $_fields for each field.
52 *
53 * @var array
54 */
55 static $_fieldKeys = null;
56 /**
57 * static instance to hold the FK relationships
58 *
59 * @var string
60 */
61 static $_links = null;
e501603b
TO
62 /**
63 * static value to see if we should log any modifications to
64 * this table in the civicrm_log table
65 *
66 * @var boolean
67 */
68 static $_log = false;
69 /**
70 *
71 * @var int unsigned
72 */
73 public $id;
74 /**
75 * FK to civicrm_mailing_event_subscribe
76 *
77 * @var int unsigned
78 */
79 public $event_subscribe_id;
80 /**
81 * When this confirmation event occurred.
82 *
83 * @var datetime
84 */
85 public $time_stamp;
86 /**
87 * class constructor
88 *
89 * @return civicrm_mailing_event_confirm
90 */
91 function __construct() {
92 $this->__table = 'civicrm_mailing_event_confirm';
93 parent::__construct();
94 }
95 /**
96 * Returns foreign keys and entity references
97 *
98 * @return array
99 * [CRM_Core_Reference_Interface]
100 */
101 static function getReferenceColumns() {
102 if (!self::$_links) {
103 self::$_links = static ::createReferenceColumns(__CLASS__);
104 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'event_subscribe_id', 'civicrm_mailing_event_subscribe', 'id');
105 }
106 return self::$_links;
107 }
108 /**
109 * Returns all the column names of this table
110 *
111 * @return array
112 */
113 static function &fields() {
114 if (!(self::$_fields)) {
115 self::$_fields = array(
116 'id' => array(
117 'name' => 'id',
118 'type' => CRM_Utils_Type::T_INT,
119 'title' => ts('Mailing Confirmation ID') ,
120 'required' => true,
121 ) ,
122 'event_subscribe_id' => array(
123 'name' => 'event_subscribe_id',
124 'type' => CRM_Utils_Type::T_INT,
125 'title' => ts('Mailing Subscribe ID') ,
126 'description' => 'FK to civicrm_mailing_event_subscribe',
127 'required' => true,
128 'FKClassName' => 'CRM_Mailing_Event_DAO_Subscribe',
129 ) ,
130 'time_stamp' => array(
131 'name' => 'time_stamp',
132 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
133 'title' => ts('Confirm Timestamp') ,
134 'description' => 'When this confirmation event occurred.',
135 'required' => true,
136 ) ,
137 );
138 }
139 return self::$_fields;
140 }
141 /**
142 * Returns an array containing, for each field, the arary key used for that
143 * field in self::$_fields.
144 *
145 * @return array
146 */
147 static function &fieldKeys() {
148 if (!(self::$_fieldKeys)) {
149 self::$_fieldKeys = array(
150 'id' => 'id',
151 'event_subscribe_id' => 'event_subscribe_id',
152 'time_stamp' => 'time_stamp',
153 );
154 }
155 return self::$_fieldKeys;
156 }
157 /**
158 * Returns the names of this table
159 *
160 * @return string
161 */
162 static function getTableName() {
163 return self::$_tableName;
164 }
165 /**
166 * Returns if this table needs to be logged
167 *
168 * @return boolean
169 */
170 function getLog() {
171 return self::$_log;
172 }
173 /**
174 * Returns the list of fields that can be imported
175 *
176 * @param bool $prefix
177 *
178 * @return array
179 */
180 static function &import($prefix = false) {
60808919
TO
181 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_confirm', $prefix, array());
182 return $r;
e501603b
TO
183 }
184 /**
185 * Returns the list of fields that can be exported
186 *
187 * @param bool $prefix
188 *
189 * @return array
190 */
191 static function &export($prefix = false) {
60808919
TO
192 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_confirm', $prefix, array());
193 return $r;
e501603b
TO
194 }
195}