CRM-14885 - Import DAO's
[civicrm-core.git] / CRM / Core / DAO / RecurringEntity.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/Core/RecurringEntity.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:b1fbcf5291f3766de514bcde365743a9)
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
37class CRM_Core_DAO_RecurringEntity extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_recurring_entity';
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;
62 /**
63 * static instance to hold the values that can
64 * be imported
65 *
66 * @var array
67 */
68 static $_import = null;
69 /**
70 * static instance to hold the values that can
71 * be exported
72 *
73 * @var array
74 */
75 static $_export = null;
76 /**
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
79 *
80 * @var boolean
81 */
82 static $_log = true;
83 /**
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * Recurring Entity Parent ID
90 *
91 * @var int unsigned
92 */
93 public $parent_id;
94 /**
95 * Recurring Entity Child ID
96 *
97 * @var int unsigned
98 */
99 public $entity_id;
100 /**
101 * Physical tablename for entity, e.g. civicrm_event
102 *
103 * @var string
104 */
105 public $entity_table;
106 /**
107 * 1-this entity, 2-this and the following entities, 3-all the entities
108 *
109 * @var boolean
110 */
111 public $mode;
112 /**
113 * class constructor
114 *
115 * @return civicrm_recurring_entity
116 */
117 function __construct() {
118 $this->__table = 'civicrm_recurring_entity';
119 parent::__construct();
120 }
121 /**
122 * Returns all the column names of this table
123 *
124 * @return array
125 */
126 static function &fields() {
127 if (!(self::$_fields)) {
128 self::$_fields = array(
129 'id' => array(
130 'name' => 'id',
131 'type' => CRM_Utils_Type::T_INT,
132 'title' => ts('ID') ,
133 'required' => true,
134 ) ,
135 'parent_id' => array(
136 'name' => 'parent_id',
137 'type' => CRM_Utils_Type::T_INT,
138 'title' => ts('Parent ID') ,
139 'description' => 'Recurring Entity Parent ID',
140 'required' => true,
141 ) ,
142 'entity_id' => array(
143 'name' => 'entity_id',
144 'type' => CRM_Utils_Type::T_INT,
145 'title' => ts('Entity ID') ,
146 'description' => 'Recurring Entity Child ID',
147 ) ,
148 'entity_table' => array(
149 'name' => 'entity_table',
150 'type' => CRM_Utils_Type::T_STRING,
151 'title' => ts('Entity Table') ,
152 'description' => 'Physical tablename for entity, e.g. civicrm_event',
153 'required' => true,
154 'maxlength' => 64,
155 'size' => CRM_Utils_Type::BIG,
156 ) ,
157 'mode' => array(
158 'name' => 'mode',
159 'type' => CRM_Utils_Type::T_BOOLEAN,
160 'title' => ts('Cascade Type') ,
161 'description' => '1-this entity, 2-this and the following entities, 3-all the entities',
162 'required' => true,
163 'default' => '1',
164 ) ,
165 );
166 }
167 return self::$_fields;
168 }
169 /**
170 * Returns an array containing, for each field, the arary key used for that
171 * field in self::$_fields.
172 *
173 * @return array
174 */
175 static function &fieldKeys() {
176 if (!(self::$_fieldKeys)) {
177 self::$_fieldKeys = array(
178 'id' => 'id',
179 'parent_id' => 'parent_id',
180 'entity_id' => 'entity_id',
181 'entity_table' => 'entity_table',
182 'mode' => 'mode',
183 );
184 }
185 return self::$_fieldKeys;
186 }
187 /**
188 * Returns the names of this table
189 *
190 * @return string
191 */
192 static function getTableName() {
193 return self::$_tableName;
194 }
195 /**
196 * Returns if this table needs to be logged
197 *
198 * @return boolean
199 */
200 function getLog() {
201 return self::$_log;
202 }
203 /**
204 * Returns the list of fields that can be imported
205 *
206 * @param bool $prefix
207 *
208 * @return array
209 */
210 static function &import($prefix = false) {
211 if (!(self::$_import)) {
212 self::$_import = array();
213 $fields = self::fields();
214 foreach($fields as $name => $field) {
215 if (CRM_Utils_Array::value('import', $field)) {
216 if ($prefix) {
217 self::$_import['recurring_entity'] = & $fields[$name];
218 } else {
219 self::$_import[$name] = & $fields[$name];
220 }
221 }
222 }
223 }
224 return self::$_import;
225 }
226 /**
227 * Returns the list of fields that can be exported
228 *
229 * @param bool $prefix
230 *
231 * @return array
232 */
233 static function &export($prefix = false) {
234 if (!(self::$_export)) {
235 self::$_export = array();
236 $fields = self::fields();
237 foreach($fields as $name => $field) {
238 if (CRM_Utils_Array::value('export', $field)) {
239 if ($prefix) {
240 self::$_export['recurring_entity'] = & $fields[$name];
241 } else {
242 self::$_export[$name] = & $fields[$name];
243 }
244 }
245 }
246 }
247 return self::$_export;
248 }
249}