Commit | Line | Data |
---|---|---|
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/WordReplacement.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
437fafcf | 33 | * (GenCodeChecksum:92b2139ba33ee66fec3e6bb529af304e) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
f41f0342 | 37 | /** |
38 | * CRM_Core_DAO_WordReplacement constructor. | |
39 | */ | |
e501603b TO |
40 | class CRM_Core_DAO_WordReplacement 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_word_replacement'; | |
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 | * Word replacement ID | |
55 | * | |
56 | * @var int unsigned | |
57 | */ | |
58 | public $id; | |
59 | /** | |
60 | * Word which need to be replaced | |
61 | * | |
62 | * @var string | |
63 | */ | |
64 | public $find_word; | |
65 | /** | |
66 | * Word which will replace the word in find | |
67 | * | |
68 | * @var string | |
69 | */ | |
70 | public $replace_word; | |
71 | /** | |
72 | * Is this entry active? | |
73 | * | |
74 | * @var boolean | |
75 | */ | |
76 | public $is_active; | |
77 | /** | |
78 | * | |
79 | * @var string | |
80 | */ | |
81 | public $match_type; | |
82 | /** | |
83 | * FK to Domain ID. This is for Domain specific word replacement | |
84 | * | |
85 | * @var int unsigned | |
86 | */ | |
87 | public $domain_id; | |
88 | /** | |
f41f0342 | 89 | * Class constructor. |
e501603b TO |
90 | */ |
91 | function __construct() { | |
92 | $this->__table = 'civicrm_word_replacement'; | |
93 | parent::__construct(); | |
94 | } | |
95 | /** | |
f41f0342 | 96 | * Returns foreign keys and entity references. |
e501603b TO |
97 | * |
98 | * @return array | |
99 | * [CRM_Core_Reference_Interface] | |
100 | */ | |
101 | static function getReferenceColumns() { | |
346aaaba TO |
102 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
103 | Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__); | |
104 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id'); | |
105 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); | |
e501603b | 106 | } |
346aaaba | 107 | return Civi::$statics[__CLASS__]['links']; |
e501603b TO |
108 | } |
109 | /** | |
110 | * Returns all the column names of this table | |
111 | * | |
112 | * @return array | |
113 | */ | |
114 | static function &fields() { | |
346aaaba TO |
115 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
116 | Civi::$statics[__CLASS__]['fields'] = array( | |
e501603b TO |
117 | 'id' => array( |
118 | 'name' => 'id', | |
119 | 'type' => CRM_Utils_Type::T_INT, | |
120 | 'title' => ts('Word Replacement ID') , | |
121 | 'description' => 'Word replacement ID', | |
122 | 'required' => true, | |
123 | ) , | |
124 | 'find_word' => array( | |
125 | 'name' => 'find_word', | |
126 | 'type' => CRM_Utils_Type::T_STRING, | |
127 | 'title' => ts('Replaced Word') , | |
128 | 'description' => 'Word which need to be replaced', | |
129 | 'maxlength' => 255, | |
130 | 'size' => CRM_Utils_Type::HUGE, | |
131 | ) , | |
132 | 'replace_word' => array( | |
133 | 'name' => 'replace_word', | |
134 | 'type' => CRM_Utils_Type::T_STRING, | |
135 | 'title' => ts('Replacement Word') , | |
136 | 'description' => 'Word which will replace the word in find', | |
137 | 'maxlength' => 255, | |
138 | 'size' => CRM_Utils_Type::HUGE, | |
139 | ) , | |
140 | 'is_active' => array( | |
141 | 'name' => 'is_active', | |
142 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
143 | 'title' => ts('Word Replacement is Active') , | |
144 | 'description' => 'Is this entry active?', | |
145 | 'default' => '1', | |
146 | ) , | |
147 | 'match_type' => array( | |
148 | 'name' => 'match_type', | |
149 | 'type' => CRM_Utils_Type::T_STRING, | |
150 | 'title' => ts('Word Replacement Match Type') , | |
151 | 'maxlength' => 16, | |
152 | 'size' => CRM_Utils_Type::TWELVE, | |
153 | 'default' => 'wildcardMatch', | |
154 | 'html' => array( | |
155 | 'type' => 'Select', | |
156 | ) , | |
157 | 'pseudoconstant' => array( | |
158 | 'callback' => 'CRM_Core_SelectValues::getWordReplacementMatchType', | |
159 | ) | |
160 | ) , | |
161 | 'domain_id' => array( | |
162 | 'name' => 'domain_id', | |
163 | 'type' => CRM_Utils_Type::T_INT, | |
164 | 'title' => ts('Word Replacement Domain ID') , | |
165 | 'description' => 'FK to Domain ID. This is for Domain specific word replacement', | |
166 | 'FKClassName' => 'CRM_Core_DAO_Domain', | |
167 | 'pseudoconstant' => array( | |
168 | 'table' => 'civicrm_domain', | |
169 | 'keyColumn' => 'id', | |
170 | 'labelColumn' => 'name', | |
171 | ) | |
172 | ) , | |
173 | ); | |
346aaaba | 174 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 175 | } |
346aaaba | 176 | return Civi::$statics[__CLASS__]['fields']; |
e501603b TO |
177 | } |
178 | /** | |
bd8e0b14 | 179 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
180 | * |
181 | * @return array | |
bd8e0b14 | 182 | * Array(string $name => string $uniqueName). |
e501603b TO |
183 | */ |
184 | static function &fieldKeys() { | |
bd8e0b14 TO |
185 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
186 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 187 | } |
bd8e0b14 | 188 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b TO |
189 | } |
190 | /** | |
191 | * Returns the names of this table | |
192 | * | |
193 | * @return string | |
194 | */ | |
195 | static function getTableName() { | |
196 | return self::$_tableName; | |
197 | } | |
198 | /** | |
199 | * Returns if this table needs to be logged | |
200 | * | |
201 | * @return boolean | |
202 | */ | |
203 | function getLog() { | |
204 | return self::$_log; | |
205 | } | |
206 | /** | |
207 | * Returns the list of fields that can be imported | |
208 | * | |
209 | * @param bool $prefix | |
210 | * | |
211 | * @return array | |
212 | */ | |
213 | static function &import($prefix = false) { | |
60808919 TO |
214 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'word_replacement', $prefix, array()); |
215 | return $r; | |
e501603b TO |
216 | } |
217 | /** | |
218 | * Returns the list of fields that can be exported | |
219 | * | |
220 | * @param bool $prefix | |
221 | * | |
222 | * @return array | |
223 | */ | |
224 | static function &export($prefix = false) { | |
60808919 TO |
225 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'word_replacement', $prefix, array()); |
226 | return $r; | |
e501603b TO |
227 | } |
228 | } |