Merge pull request #10540 from colemanw/CRM-20091
[civicrm-core.git] / CRM / Core / DAO / Persistent.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
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-2017
30 *
31 * Generated from xml/schema/CRM/Core/Persistent.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:f215d2eac0f061ca085bcee3c4dca25f)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Core_DAO_Persistent constructor.
39 */
40 class CRM_Core_DAO_Persistent extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_persistent';
47 /**
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
49 *
50 * @var boolean
51 */
52 static $_log = false;
53 /**
54 * Persistent Record Id
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 * Context for which name data pair is to be stored
61 *
62 * @var string
63 */
64 public $context;
65 /**
66 * Name of Context
67 *
68 * @var string
69 */
70 public $name;
71 /**
72 * data associated with name
73 *
74 * @var longtext
75 */
76 public $data;
77 /**
78 * Config Settings
79 *
80 * @var boolean
81 */
82 public $is_config;
83 /**
84 * Class constructor.
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() {
96 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
97 Civi::$statics[__CLASS__]['fields'] = array(
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 'table_name' => 'civicrm_persistent',
105 'entity' => 'Persistent',
106 'bao' => 'CRM_Core_BAO_Persistent',
107 'localizable' => 0,
108 ) ,
109 'context' => array(
110 'name' => 'context',
111 'type' => CRM_Utils_Type::T_STRING,
112 'title' => ts('Context') ,
113 'description' => 'Context for which name data pair is to be stored',
114 'required' => true,
115 'maxlength' => 255,
116 'size' => CRM_Utils_Type::HUGE,
117 'table_name' => 'civicrm_persistent',
118 'entity' => 'Persistent',
119 'bao' => 'CRM_Core_BAO_Persistent',
120 'localizable' => 0,
121 ) ,
122 'name' => array(
123 'name' => 'name',
124 'type' => CRM_Utils_Type::T_STRING,
125 'title' => ts('Name') ,
126 'description' => 'Name of Context',
127 'required' => true,
128 'maxlength' => 255,
129 'size' => CRM_Utils_Type::HUGE,
130 'table_name' => 'civicrm_persistent',
131 'entity' => 'Persistent',
132 'bao' => 'CRM_Core_BAO_Persistent',
133 'localizable' => 0,
134 ) ,
135 'data' => array(
136 'name' => 'data',
137 'type' => CRM_Utils_Type::T_LONGTEXT,
138 'title' => ts('Data') ,
139 'description' => 'data associated with name',
140 'table_name' => 'civicrm_persistent',
141 'entity' => 'Persistent',
142 'bao' => 'CRM_Core_BAO_Persistent',
143 'localizable' => 0,
144 ) ,
145 'is_config' => array(
146 'name' => 'is_config',
147 'type' => CRM_Utils_Type::T_BOOLEAN,
148 'title' => ts('Is Configuration?') ,
149 'description' => 'Config Settings',
150 'required' => true,
151 'table_name' => 'civicrm_persistent',
152 'entity' => 'Persistent',
153 'bao' => 'CRM_Core_BAO_Persistent',
154 'localizable' => 0,
155 ) ,
156 );
157 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
158 }
159 return Civi::$statics[__CLASS__]['fields'];
160 }
161 /**
162 * Return a mapping from field-name to the corresponding key (as used in fields()).
163 *
164 * @return array
165 * Array(string $name => string $uniqueName).
166 */
167 static function &fieldKeys() {
168 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
169 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
170 }
171 return Civi::$statics[__CLASS__]['fieldKeys'];
172 }
173 /**
174 * Returns the names of this table
175 *
176 * @return string
177 */
178 static function getTableName() {
179 return self::$_tableName;
180 }
181 /**
182 * Returns if this table needs to be logged
183 *
184 * @return boolean
185 */
186 function getLog() {
187 return self::$_log;
188 }
189 /**
190 * Returns the list of fields that can be imported
191 *
192 * @param bool $prefix
193 *
194 * @return array
195 */
196 static function &import($prefix = false) {
197 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'persistent', $prefix, array());
198 return $r;
199 }
200 /**
201 * Returns the list of fields that can be exported
202 *
203 * @param bool $prefix
204 *
205 * @return array
206 */
207 static function &export($prefix = false) {
208 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'persistent', $prefix, array());
209 return $r;
210 }
211 /**
212 * Returns the list of indices
213 */
214 public static function indices($localize = TRUE) {
215 $indices = array();
216 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
217 }
218 }