Commit | Line | Data |
---|---|---|
e501603b TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
4 | | CiviCRM version 4.7 | | |
5 | +--------------------------------------------------------------------+ | |
0f03f337 | 6 | | Copyright CiviCRM LLC (c) 2004-2017 | |
e501603b TO |
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 | |
0f03f337 | 29 | * @copyright CiviCRM LLC (c) 2004-2017 |
e501603b TO |
30 | * |
31 | * Generated from xml/schema/CRM/Core/Persistent.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
437fafcf | 33 | * (GenCodeChecksum:9b08831f82375bb41e0f54c03b69b79e) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
37 | class CRM_Core_DAO_Persistent extends CRM_Core_DAO { | |
38 | /** | |
39 | * static instance to hold the table name | |
40 | * | |
41 | * @var string | |
42 | */ | |
43 | static $_tableName = 'civicrm_persistent'; | |
e501603b TO |
44 | /** |
45 | * static value to see if we should log any modifications to | |
46 | * this table in the civicrm_log table | |
47 | * | |
48 | * @var boolean | |
49 | */ | |
50 | static $_log = false; | |
51 | /** | |
52 | * Persistent Record Id | |
53 | * | |
54 | * @var int unsigned | |
55 | */ | |
56 | public $id; | |
57 | /** | |
58 | * Context for which name data pair is to be stored | |
59 | * | |
60 | * @var string | |
61 | */ | |
62 | public $context; | |
63 | /** | |
64 | * Name of Context | |
65 | * | |
66 | * @var string | |
67 | */ | |
68 | public $name; | |
69 | /** | |
70 | * data associated with name | |
71 | * | |
72 | * @var longtext | |
73 | */ | |
74 | public $data; | |
75 | /** | |
76 | * Config Settings | |
77 | * | |
78 | * @var boolean | |
79 | */ | |
80 | public $is_config; | |
81 | /** | |
82 | * class constructor | |
83 | * | |
84 | * @return civicrm_persistent | |
85 | */ | |
86 | function __construct() { | |
87 | $this->__table = 'civicrm_persistent'; | |
88 | parent::__construct(); | |
89 | } | |
90 | /** | |
91 | * Returns all the column names of this table | |
92 | * | |
93 | * @return array | |
94 | */ | |
95 | static function &fields() { | |
346aaaba TO |
96 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
97 | Civi::$statics[__CLASS__]['fields'] = array( | |
e501603b TO |
98 | 'id' => array( |
99 | 'name' => 'id', | |
100 | 'type' => CRM_Utils_Type::T_INT, | |
101 | 'title' => ts('Persistent ID') , | |
102 | 'description' => 'Persistent Record Id', | |
103 | 'required' => true, | |
104 | ) , | |
105 | 'context' => array( | |
106 | 'name' => 'context', | |
107 | 'type' => CRM_Utils_Type::T_STRING, | |
108 | 'title' => ts('Context') , | |
109 | 'description' => 'Context for which name data pair is to be stored', | |
110 | 'required' => true, | |
111 | 'maxlength' => 255, | |
112 | 'size' => CRM_Utils_Type::HUGE, | |
113 | ) , | |
114 | 'name' => array( | |
115 | 'name' => 'name', | |
116 | 'type' => CRM_Utils_Type::T_STRING, | |
117 | 'title' => ts('Name') , | |
118 | 'description' => 'Name of Context', | |
119 | 'required' => true, | |
120 | 'maxlength' => 255, | |
121 | 'size' => CRM_Utils_Type::HUGE, | |
122 | ) , | |
123 | 'data' => array( | |
124 | 'name' => 'data', | |
125 | 'type' => CRM_Utils_Type::T_LONGTEXT, | |
126 | 'title' => ts('Data') , | |
127 | 'description' => 'data associated with name', | |
128 | ) , | |
129 | 'is_config' => array( | |
130 | 'name' => 'is_config', | |
131 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
132 | 'title' => ts('Is Configuration?') , | |
133 | 'description' => 'Config Settings', | |
134 | 'required' => true, | |
135 | ) , | |
136 | ); | |
346aaaba | 137 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 138 | } |
346aaaba | 139 | return Civi::$statics[__CLASS__]['fields']; |
e501603b TO |
140 | } |
141 | /** | |
bd8e0b14 | 142 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
143 | * |
144 | * @return array | |
bd8e0b14 | 145 | * Array(string $name => string $uniqueName). |
e501603b TO |
146 | */ |
147 | static function &fieldKeys() { | |
bd8e0b14 TO |
148 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
149 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 150 | } |
bd8e0b14 | 151 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b TO |
152 | } |
153 | /** | |
154 | * Returns the names of this table | |
155 | * | |
156 | * @return string | |
157 | */ | |
158 | static function getTableName() { | |
159 | return self::$_tableName; | |
160 | } | |
161 | /** | |
162 | * Returns if this table needs to be logged | |
163 | * | |
164 | * @return boolean | |
165 | */ | |
166 | function getLog() { | |
167 | return self::$_log; | |
168 | } | |
169 | /** | |
170 | * Returns the list of fields that can be imported | |
171 | * | |
172 | * @param bool $prefix | |
173 | * | |
174 | * @return array | |
175 | */ | |
176 | static function &import($prefix = false) { | |
60808919 TO |
177 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'persistent', $prefix, array()); |
178 | return $r; | |
e501603b TO |
179 | } |
180 | /** | |
181 | * Returns the list of fields that can be exported | |
182 | * | |
183 | * @param bool $prefix | |
184 | * | |
185 | * @return array | |
186 | */ | |
187 | static function &export($prefix = false) { | |
60808919 TO |
188 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'persistent', $prefix, array()); |
189 | return $r; | |
e501603b TO |
190 | } |
191 | } |