a3257570f75f4a2ce4bc02ac7421a7d4e6d39195
[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:435a9aa78f94ebc91ddf5cccd749c06c)
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 ) ,
108 'context' => array(
109 'name' => 'context',
110 'type' => CRM_Utils_Type::T_STRING,
111 'title' => ts('Context') ,
112 'description' => 'Context for which name data pair is to be stored',
113 'required' => true,
114 'maxlength' => 255,
115 'size' => CRM_Utils_Type::HUGE,
116 'table_name' => 'civicrm_persistent',
117 'entity' => 'Persistent',
118 'bao' => 'CRM_Core_BAO_Persistent',
119 ) ,
120 'name' => array(
121 'name' => 'name',
122 'type' => CRM_Utils_Type::T_STRING,
123 'title' => ts('Name') ,
124 'description' => 'Name of Context',
125 'required' => true,
126 'maxlength' => 255,
127 'size' => CRM_Utils_Type::HUGE,
128 'table_name' => 'civicrm_persistent',
129 'entity' => 'Persistent',
130 'bao' => 'CRM_Core_BAO_Persistent',
131 ) ,
132 'data' => array(
133 'name' => 'data',
134 'type' => CRM_Utils_Type::T_LONGTEXT,
135 'title' => ts('Data') ,
136 'description' => 'data associated with name',
137 'table_name' => 'civicrm_persistent',
138 'entity' => 'Persistent',
139 'bao' => 'CRM_Core_BAO_Persistent',
140 ) ,
141 'is_config' => array(
142 'name' => 'is_config',
143 'type' => CRM_Utils_Type::T_BOOLEAN,
144 'title' => ts('Is Configuration?') ,
145 'description' => 'Config Settings',
146 'required' => true,
147 'table_name' => 'civicrm_persistent',
148 'entity' => 'Persistent',
149 'bao' => 'CRM_Core_BAO_Persistent',
150 ) ,
151 );
152 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
153 }
154 return Civi::$statics[__CLASS__]['fields'];
155 }
156 /**
157 * Return a mapping from field-name to the corresponding key (as used in fields()).
158 *
159 * @return array
160 * Array(string $name => string $uniqueName).
161 */
162 static function &fieldKeys() {
163 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
164 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
165 }
166 return Civi::$statics[__CLASS__]['fieldKeys'];
167 }
168 /**
169 * Returns the names of this table
170 *
171 * @return string
172 */
173 static function getTableName() {
174 return self::$_tableName;
175 }
176 /**
177 * Returns if this table needs to be logged
178 *
179 * @return boolean
180 */
181 function getLog() {
182 return self::$_log;
183 }
184 /**
185 * Returns the list of fields that can be imported
186 *
187 * @param bool $prefix
188 *
189 * @return array
190 */
191 static function &import($prefix = false) {
192 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'persistent', $prefix, array());
193 return $r;
194 }
195 /**
196 * Returns the list of fields that can be exported
197 *
198 * @param bool $prefix
199 *
200 * @return array
201 */
202 static function &export($prefix = false) {
203 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'persistent', $prefix, array());
204 return $r;
205 }
206 }