Commit | Line | Data |
---|---|---|
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 | |
437fafcf | 33 | * (GenCodeChecksum:313755d167ca428c11a245f50a786127) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
37 | class 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; | |
e501603b TO |
50 | /** |
51 | * static instance to hold the FK relationships | |
52 | * | |
53 | * @var string | |
54 | */ | |
55 | static $_links = null; | |
e501603b TO |
56 | /** |
57 | * static value to see if we should log any modifications to | |
58 | * this table in the civicrm_log table | |
59 | * | |
60 | * @var boolean | |
61 | */ | |
62 | static $_log = true; | |
63 | /** | |
64 | * | |
65 | * @var int unsigned | |
66 | */ | |
67 | public $id; | |
68 | /** | |
69 | * Recurring Entity Parent ID | |
70 | * | |
71 | * @var int unsigned | |
72 | */ | |
73 | public $parent_id; | |
74 | /** | |
75 | * Recurring Entity Child ID | |
76 | * | |
77 | * @var int unsigned | |
78 | */ | |
79 | public $entity_id; | |
80 | /** | |
81 | * Physical tablename for entity, e.g. civicrm_event | |
82 | * | |
83 | * @var string | |
84 | */ | |
85 | public $entity_table; | |
86 | /** | |
87 | * 1-this entity, 2-this and the following entities, 3-all the entities | |
88 | * | |
89 | * @var boolean | |
90 | */ | |
91 | public $mode; | |
92 | /** | |
93 | * class constructor | |
94 | * | |
95 | * @return civicrm_recurring_entity | |
96 | */ | |
97 | function __construct() { | |
98 | $this->__table = 'civicrm_recurring_entity'; | |
99 | parent::__construct(); | |
100 | } | |
101 | /** | |
102 | * Returns all the column names of this table | |
103 | * | |
104 | * @return array | |
105 | */ | |
106 | static function &fields() { | |
107 | if (!(self::$_fields)) { | |
108 | self::$_fields = array( | |
109 | 'id' => array( | |
110 | 'name' => 'id', | |
111 | 'type' => CRM_Utils_Type::T_INT, | |
112 | 'title' => ts('ID') , | |
113 | 'required' => true, | |
114 | ) , | |
115 | 'parent_id' => array( | |
116 | 'name' => 'parent_id', | |
117 | 'type' => CRM_Utils_Type::T_INT, | |
118 | 'title' => ts('Parent ID') , | |
119 | 'description' => 'Recurring Entity Parent ID', | |
120 | 'required' => true, | |
121 | ) , | |
122 | 'entity_id' => array( | |
123 | 'name' => 'entity_id', | |
124 | 'type' => CRM_Utils_Type::T_INT, | |
125 | 'title' => ts('Entity ID') , | |
126 | 'description' => 'Recurring Entity Child ID', | |
127 | ) , | |
128 | 'entity_table' => array( | |
129 | 'name' => 'entity_table', | |
130 | 'type' => CRM_Utils_Type::T_STRING, | |
131 | 'title' => ts('Entity Table') , | |
132 | 'description' => 'Physical tablename for entity, e.g. civicrm_event', | |
133 | 'required' => true, | |
134 | 'maxlength' => 64, | |
135 | 'size' => CRM_Utils_Type::BIG, | |
136 | ) , | |
137 | 'mode' => array( | |
138 | 'name' => 'mode', | |
139 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
140 | 'title' => ts('Cascade Type') , | |
141 | 'description' => '1-this entity, 2-this and the following entities, 3-all the entities', | |
142 | 'required' => true, | |
143 | 'default' => '1', | |
144 | ) , | |
145 | ); | |
146 | } | |
147 | return self::$_fields; | |
148 | } | |
149 | /** | |
bd8e0b14 | 150 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
151 | * |
152 | * @return array | |
bd8e0b14 | 153 | * Array(string $name => string $uniqueName). |
e501603b TO |
154 | */ |
155 | static function &fieldKeys() { | |
bd8e0b14 TO |
156 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
157 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 158 | } |
bd8e0b14 | 159 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b TO |
160 | } |
161 | /** | |
162 | * Returns the names of this table | |
163 | * | |
164 | * @return string | |
165 | */ | |
166 | static function getTableName() { | |
167 | return self::$_tableName; | |
168 | } | |
169 | /** | |
170 | * Returns if this table needs to be logged | |
171 | * | |
172 | * @return boolean | |
173 | */ | |
174 | function getLog() { | |
175 | return self::$_log; | |
176 | } | |
177 | /** | |
178 | * Returns the list of fields that can be imported | |
179 | * | |
180 | * @param bool $prefix | |
181 | * | |
182 | * @return array | |
183 | */ | |
184 | static function &import($prefix = false) { | |
60808919 TO |
185 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'recurring_entity', $prefix, array()); |
186 | return $r; | |
e501603b TO |
187 | } |
188 | /** | |
189 | * Returns the list of fields that can be exported | |
190 | * | |
191 | * @param bool $prefix | |
192 | * | |
193 | * @return array | |
194 | */ | |
195 | static function &export($prefix = false) { | |
60808919 TO |
196 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'recurring_entity', $prefix, array()); |
197 | return $r; | |
e501603b TO |
198 | } |
199 | } |