CRM-20312 add field localisation data to DAO.
[civicrm-core.git] / CRM / Core / DAO / Persistent.php
CommitLineData
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
022785d8 33 * (GenCodeChecksum:f215d2eac0f061ca085bcee3c4dca25f)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
f41f0342 37/**
38 * CRM_Core_DAO_Persistent constructor.
39 */
e501603b
TO
40class CRM_Core_DAO_Persistent extends CRM_Core_DAO {
41 /**
f41f0342 42 * Static instance to hold the table name.
e501603b
TO
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_persistent';
e501603b 47 /**
f41f0342 48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b
TO
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 /**
f41f0342 84 * Class constructor.
e501603b
TO
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,
522a26c9 104 'table_name' => 'civicrm_persistent',
105 'entity' => 'Persistent',
106 'bao' => 'CRM_Core_BAO_Persistent',
e501603b
TO
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,
522a26c9 116 'table_name' => 'civicrm_persistent',
117 'entity' => 'Persistent',
118 'bao' => 'CRM_Core_BAO_Persistent',
e501603b
TO
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,
522a26c9 128 'table_name' => 'civicrm_persistent',
129 'entity' => 'Persistent',
130 'bao' => 'CRM_Core_BAO_Persistent',
e501603b
TO
131 ) ,
132 'data' => array(
133 'name' => 'data',
134 'type' => CRM_Utils_Type::T_LONGTEXT,
135 'title' => ts('Data') ,
136 'description' => 'data associated with name',
522a26c9 137 'table_name' => 'civicrm_persistent',
138 'entity' => 'Persistent',
139 'bao' => 'CRM_Core_BAO_Persistent',
e501603b
TO
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,
522a26c9 147 'table_name' => 'civicrm_persistent',
148 'entity' => 'Persistent',
149 'bao' => 'CRM_Core_BAO_Persistent',
e501603b
TO
150 ) ,
151 );
346aaaba 152 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 153 }
346aaaba 154 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
155 }
156 /**
bd8e0b14 157 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
158 *
159 * @return array
bd8e0b14 160 * Array(string $name => string $uniqueName).
e501603b
TO
161 */
162 static function &fieldKeys() {
bd8e0b14
TO
163 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
164 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 165 }
bd8e0b14 166 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
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) {
60808919
TO
192 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'persistent', $prefix, array());
193 return $r;
e501603b
TO
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) {
60808919
TO
203 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'persistent', $prefix, array());
204 return $r;
e501603b
TO
205 }
206}