3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Core/WordReplacement.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:550a500d2c0a05672ebf9e2a47d54d69)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Core_DAO_WordReplacement constructor.
40 class CRM_Core_DAO_WordReplacement
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_word_replacement';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Word which need to be replaced
66 * Word which will replace the word in find
72 * Is this entry active?
83 * FK to Domain ID. This is for Domain specific word replacement
91 function __construct() {
92 $this->__table
= 'civicrm_word_replacement';
93 parent
::__construct();
96 * Returns foreign keys and entity references.
99 * [CRM_Core_Reference_Interface]
101 static function getReferenceColumns() {
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']);
107 return Civi
::$statics[__CLASS__
]['links'];
110 * Returns all the column names of this table
114 static function &fields() {
115 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
116 Civi
::$statics[__CLASS__
]['fields'] = array(
119 'type' => CRM_Utils_Type
::T_INT
,
120 'title' => ts('Word Replacement ID') ,
121 'description' => 'Word replacement ID',
123 'table_name' => 'civicrm_word_replacement',
124 'entity' => 'WordReplacement',
125 'bao' => 'CRM_Core_BAO_WordReplacement',
128 'find_word' => array(
129 'name' => 'find_word',
130 'type' => CRM_Utils_Type
::T_STRING
,
131 'title' => ts('Replaced Word') ,
132 'description' => 'Word which need to be replaced',
134 'size' => CRM_Utils_Type
::HUGE
,
135 'table_name' => 'civicrm_word_replacement',
136 'entity' => 'WordReplacement',
137 'bao' => 'CRM_Core_BAO_WordReplacement',
140 'replace_word' => array(
141 'name' => 'replace_word',
142 'type' => CRM_Utils_Type
::T_STRING
,
143 'title' => ts('Replacement Word') ,
144 'description' => 'Word which will replace the word in find',
146 'size' => CRM_Utils_Type
::HUGE
,
147 'table_name' => 'civicrm_word_replacement',
148 'entity' => 'WordReplacement',
149 'bao' => 'CRM_Core_BAO_WordReplacement',
152 'is_active' => array(
153 'name' => 'is_active',
154 'type' => CRM_Utils_Type
::T_BOOLEAN
,
155 'title' => ts('Word Replacement is Active') ,
156 'description' => 'Is this entry active?',
158 'table_name' => 'civicrm_word_replacement',
159 'entity' => 'WordReplacement',
160 'bao' => 'CRM_Core_BAO_WordReplacement',
163 'match_type' => array(
164 'name' => 'match_type',
165 'type' => CRM_Utils_Type
::T_STRING
,
166 'title' => ts('Word Replacement Match Type') ,
168 'size' => CRM_Utils_Type
::TWELVE
,
169 'default' => 'wildcardMatch',
170 'table_name' => 'civicrm_word_replacement',
171 'entity' => 'WordReplacement',
172 'bao' => 'CRM_Core_BAO_WordReplacement',
177 'pseudoconstant' => array(
178 'callback' => 'CRM_Core_SelectValues::getWordReplacementMatchType',
181 'domain_id' => array(
182 'name' => 'domain_id',
183 'type' => CRM_Utils_Type
::T_INT
,
184 'title' => ts('Word Replacement Domain ID') ,
185 'description' => 'FK to Domain ID. This is for Domain specific word replacement',
186 'table_name' => 'civicrm_word_replacement',
187 'entity' => 'WordReplacement',
188 'bao' => 'CRM_Core_BAO_WordReplacement',
190 'FKClassName' => 'CRM_Core_DAO_Domain',
191 'pseudoconstant' => array(
192 'table' => 'civicrm_domain',
194 'labelColumn' => 'name',
198 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
200 return Civi
::$statics[__CLASS__
]['fields'];
203 * Return a mapping from field-name to the corresponding key (as used in fields()).
206 * Array(string $name => string $uniqueName).
208 static function &fieldKeys() {
209 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
210 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
212 return Civi
::$statics[__CLASS__
]['fieldKeys'];
215 * Returns the names of this table
219 static function getTableName() {
220 return self
::$_tableName;
223 * Returns if this table needs to be logged
231 * Returns the list of fields that can be imported
233 * @param bool $prefix
237 static function &import($prefix = false) {
238 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'word_replacement', $prefix, array());
242 * Returns the list of fields that can be exported
244 * @param bool $prefix
248 static function &export($prefix = false) {
249 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'word_replacement', $prefix, array());
253 * Returns the list of indices
255 public static function indices($localize = TRUE) {
257 'UI_domain_find' => array(
258 'name' => 'UI_domain_find',
263 'localizable' => false,
265 'sig' => 'civicrm_word_replacement::1::domain_id::find_word',
268 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;