(dev/core#959) Expose contribution page in Contribution Summary report
[civicrm-core.git] / CRM / Core / DAO / WordReplacement.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Core/WordReplacement.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:df2cde8fb1f65a25db724d35387a1342)
10 */
11
12 /**
13 * Database access object for the WordReplacement entity.
14 */
15 class CRM_Core_DAO_WordReplacement extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_word_replacement';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 public static $_log = FALSE;
30
31 /**
32 * Word replacement ID
33 *
34 * @var int unsigned
35 */
36 public $id;
37
38 /**
39 * Word which need to be replaced
40 *
41 * @var string
42 */
43 public $find_word;
44
45 /**
46 * Word which will replace the word in find
47 *
48 * @var string
49 */
50 public $replace_word;
51
52 /**
53 * Is this entry active?
54 *
55 * @var boolean
56 */
57 public $is_active;
58
59 /**
60 * @var string
61 */
62 public $match_type;
63
64 /**
65 * FK to Domain ID. This is for Domain specific word replacement
66 *
67 * @var int unsigned
68 */
69 public $domain_id;
70
71 /**
72 * Class constructor.
73 */
74 public function __construct() {
75 $this->__table = 'civicrm_word_replacement';
76 parent::__construct();
77 }
78
79 /**
80 * Returns foreign keys and entity references.
81 *
82 * @return array
83 * [CRM_Core_Reference_Interface]
84 */
85 public static function getReferenceColumns() {
86 if (!isset(Civi::$statics[__CLASS__]['links'])) {
87 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
88 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id');
89 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
90 }
91 return Civi::$statics[__CLASS__]['links'];
92 }
93
94 /**
95 * Returns all the column names of this table
96 *
97 * @return array
98 */
99 public static function &fields() {
100 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
101 Civi::$statics[__CLASS__]['fields'] = [
102 'id' => [
103 'name' => 'id',
104 'type' => CRM_Utils_Type::T_INT,
105 'title' => ts('Word Replacement ID'),
106 'description' => ts('Word replacement ID'),
107 'required' => TRUE,
108 'where' => 'civicrm_word_replacement.id',
109 'table_name' => 'civicrm_word_replacement',
110 'entity' => 'WordReplacement',
111 'bao' => 'CRM_Core_BAO_WordReplacement',
112 'localizable' => 0,
113 ],
114 'find_word' => [
115 'name' => 'find_word',
116 'type' => CRM_Utils_Type::T_STRING,
117 'title' => ts('Replaced Word'),
118 'description' => ts('Word which need to be replaced'),
119 'maxlength' => 255,
120 'size' => CRM_Utils_Type::HUGE,
121 'where' => 'civicrm_word_replacement.find_word',
122 'table_name' => 'civicrm_word_replacement',
123 'entity' => 'WordReplacement',
124 'bao' => 'CRM_Core_BAO_WordReplacement',
125 'localizable' => 0,
126 ],
127 'replace_word' => [
128 'name' => 'replace_word',
129 'type' => CRM_Utils_Type::T_STRING,
130 'title' => ts('Replacement Word'),
131 'description' => ts('Word which will replace the word in find'),
132 'maxlength' => 255,
133 'size' => CRM_Utils_Type::HUGE,
134 'where' => 'civicrm_word_replacement.replace_word',
135 'table_name' => 'civicrm_word_replacement',
136 'entity' => 'WordReplacement',
137 'bao' => 'CRM_Core_BAO_WordReplacement',
138 'localizable' => 0,
139 ],
140 'is_active' => [
141 'name' => 'is_active',
142 'type' => CRM_Utils_Type::T_BOOLEAN,
143 'title' => ts('Word Replacement is Active'),
144 'description' => ts('Is this entry active?'),
145 'where' => 'civicrm_word_replacement.is_active',
146 'default' => '1',
147 'table_name' => 'civicrm_word_replacement',
148 'entity' => 'WordReplacement',
149 'bao' => 'CRM_Core_BAO_WordReplacement',
150 'localizable' => 0,
151 ],
152 'match_type' => [
153 'name' => 'match_type',
154 'type' => CRM_Utils_Type::T_STRING,
155 'title' => ts('Word Replacement Match Type'),
156 'maxlength' => 16,
157 'size' => CRM_Utils_Type::TWELVE,
158 'where' => 'civicrm_word_replacement.match_type',
159 'default' => 'wildcardMatch',
160 'table_name' => 'civicrm_word_replacement',
161 'entity' => 'WordReplacement',
162 'bao' => 'CRM_Core_BAO_WordReplacement',
163 'localizable' => 0,
164 'html' => [
165 'type' => 'Select',
166 ],
167 'pseudoconstant' => [
168 'callback' => 'CRM_Core_SelectValues::getWordReplacementMatchType',
169 ]
170 ],
171 'domain_id' => [
172 'name' => 'domain_id',
173 'type' => CRM_Utils_Type::T_INT,
174 'title' => ts('Word Replacement Domain ID'),
175 'description' => ts('FK to Domain ID. This is for Domain specific word replacement'),
176 'where' => 'civicrm_word_replacement.domain_id',
177 'table_name' => 'civicrm_word_replacement',
178 'entity' => 'WordReplacement',
179 'bao' => 'CRM_Core_BAO_WordReplacement',
180 'localizable' => 0,
181 'FKClassName' => 'CRM_Core_DAO_Domain',
182 'pseudoconstant' => [
183 'table' => 'civicrm_domain',
184 'keyColumn' => 'id',
185 'labelColumn' => 'name',
186 ]
187 ],
188 ];
189 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
190 }
191 return Civi::$statics[__CLASS__]['fields'];
192 }
193
194 /**
195 * Return a mapping from field-name to the corresponding key (as used in fields()).
196 *
197 * @return array
198 * Array(string $name => string $uniqueName).
199 */
200 public static function &fieldKeys() {
201 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
202 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
203 }
204 return Civi::$statics[__CLASS__]['fieldKeys'];
205 }
206
207 /**
208 * Returns the names of this table
209 *
210 * @return string
211 */
212 public static function getTableName() {
213 return self::$_tableName;
214 }
215
216 /**
217 * Returns if this table needs to be logged
218 *
219 * @return bool
220 */
221 public function getLog() {
222 return self::$_log;
223 }
224
225 /**
226 * Returns the list of fields that can be imported
227 *
228 * @param bool $prefix
229 *
230 * @return array
231 */
232 public static function &import($prefix = FALSE) {
233 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'word_replacement', $prefix, []);
234 return $r;
235 }
236
237 /**
238 * Returns the list of fields that can be exported
239 *
240 * @param bool $prefix
241 *
242 * @return array
243 */
244 public static function &export($prefix = FALSE) {
245 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'word_replacement', $prefix, []);
246 return $r;
247 }
248
249 /**
250 * Returns the list of indices
251 *
252 * @param bool $localize
253 *
254 * @return array
255 */
256 public static function indices($localize = TRUE) {
257 $indices = [
258 'UI_domain_find' => [
259 'name' => 'UI_domain_find',
260 'field' => [
261 0 => 'domain_id',
262 1 => 'find_word',
263 ],
264 'localizable' => FALSE,
265 'unique' => TRUE,
266 'sig' => 'civicrm_word_replacement::1::domain_id::find_word',
267 ],
268 ];
269 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
270 }
271
272 }