d4dc2dc1f0251812ead508d5e289798a20a93575
[civicrm-core.git] / CRM / Core / DAO / Persistent.php
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/Persistent.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:9b08831f82375bb41e0f54c03b69b79e)
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';
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 FK relationships
52 *
53 * @var string
54 */
55 static $_links = null;
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 = false;
63 /**
64 * Persistent Record Id
65 *
66 * @var int unsigned
67 */
68 public $id;
69 /**
70 * Context for which name data pair is to be stored
71 *
72 * @var string
73 */
74 public $context;
75 /**
76 * Name of Context
77 *
78 * @var string
79 */
80 public $name;
81 /**
82 * data associated with name
83 *
84 * @var longtext
85 */
86 public $data;
87 /**
88 * Config Settings
89 *
90 * @var boolean
91 */
92 public $is_config;
93 /**
94 * class constructor
95 *
96 * @return civicrm_persistent
97 */
98 function __construct() {
99 $this->__table = 'civicrm_persistent';
100 parent::__construct();
101 }
102 /**
103 * Returns all the column names of this table
104 *
105 * @return array
106 */
107 static function &fields() {
108 if (!(self::$_fields)) {
109 self::$_fields = array(
110 'id' => array(
111 'name' => 'id',
112 'type' => CRM_Utils_Type::T_INT,
113 'title' => ts('Persistent ID') ,
114 'description' => 'Persistent Record Id',
115 'required' => true,
116 ) ,
117 'context' => array(
118 'name' => 'context',
119 'type' => CRM_Utils_Type::T_STRING,
120 'title' => ts('Context') ,
121 'description' => 'Context for which name data pair is to be stored',
122 'required' => true,
123 'maxlength' => 255,
124 'size' => CRM_Utils_Type::HUGE,
125 ) ,
126 'name' => array(
127 'name' => 'name',
128 'type' => CRM_Utils_Type::T_STRING,
129 'title' => ts('Name') ,
130 'description' => 'Name of Context',
131 'required' => true,
132 'maxlength' => 255,
133 'size' => CRM_Utils_Type::HUGE,
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 ) ,
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 ) ,
148 );
149 }
150 return self::$_fields;
151 }
152 /**
153 * Return a mapping from field-name to the corresponding key (as used in fields()).
154 *
155 * @return array
156 * Array(string $name => string $uniqueName).
157 */
158 static function &fieldKeys() {
159 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
160 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
161 }
162 return Civi::$statics[__CLASS__]['fieldKeys'];
163 }
164 /**
165 * Returns the names of this table
166 *
167 * @return string
168 */
169 static function getTableName() {
170 return self::$_tableName;
171 }
172 /**
173 * Returns if this table needs to be logged
174 *
175 * @return boolean
176 */
177 function getLog() {
178 return self::$_log;
179 }
180 /**
181 * Returns the list of fields that can be imported
182 *
183 * @param bool $prefix
184 *
185 * @return array
186 */
187 static function &import($prefix = false) {
188 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'persistent', $prefix, array());
189 return $r;
190 }
191 /**
192 * Returns the list of fields that can be exported
193 *
194 * @param bool $prefix
195 *
196 * @return array
197 */
198 static function &export($prefix = false) {
199 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'persistent', $prefix, array());
200 return $r;
201 }
202 }