5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/WordReplacement.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:f423838740b39ae0935ac1282d9c5734)
13 * Database access object for the WordReplacement entity.
15 class CRM_Core_DAO_WordReplacement
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_word_replacement';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * Word which need to be replaced
46 * Word which will replace the word in find
53 * Is this entry active?
65 * FK to Domain ID. This is for Domain specific word replacement
74 public function __construct() {
75 $this->__table
= 'civicrm_word_replacement';
76 parent
::__construct();
80 * Returns foreign keys and entity references.
83 * [CRM_Core_Reference_Interface]
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']);
91 return Civi
::$statics[__CLASS__
]['links'];
95 * Returns all the column names of this table
99 public static function &fields() {
100 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
101 Civi
::$statics[__CLASS__
]['fields'] = [
104 'type' => CRM_Utils_Type
::T_INT
,
105 'title' => ts('Word Replacement ID'),
106 'description' => ts('Word replacement ID'),
108 'where' => 'civicrm_word_replacement.id',
109 'table_name' => 'civicrm_word_replacement',
110 'entity' => 'WordReplacement',
111 'bao' => 'CRM_Core_BAO_WordReplacement',
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'),
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',
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'),
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',
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',
147 'table_name' => 'civicrm_word_replacement',
148 'entity' => 'WordReplacement',
149 'bao' => 'CRM_Core_BAO_WordReplacement',
153 'name' => 'match_type',
154 'type' => CRM_Utils_Type
::T_STRING
,
155 'title' => ts('Word Replacement Match Type'),
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',
167 'pseudoconstant' => [
168 'callback' => 'CRM_Core_SelectValues::getWordReplacementMatchType',
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',
181 'FKClassName' => 'CRM_Core_DAO_Domain',
182 'pseudoconstant' => [
183 'table' => 'civicrm_domain',
185 'labelColumn' => 'name',
189 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
191 return Civi
::$statics[__CLASS__
]['fields'];
195 * Return a mapping from field-name to the corresponding key (as used in fields()).
198 * Array(string $name => string $uniqueName).
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()));
204 return Civi
::$statics[__CLASS__
]['fieldKeys'];
208 * Returns the names of this table
212 public static function getTableName() {
213 return self
::$_tableName;
217 * Returns if this table needs to be logged
221 public function getLog() {
226 * Returns the list of fields that can be imported
228 * @param bool $prefix
232 public static function &import($prefix = FALSE) {
233 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'word_replacement', $prefix, []);
238 * Returns the list of fields that can be exported
240 * @param bool $prefix
244 public static function &export($prefix = FALSE) {
245 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'word_replacement', $prefix, []);
250 * Returns the list of indices
252 * @param bool $localize
256 public static function indices($localize = TRUE) {
258 'UI_domain_find' => [
259 'name' => 'UI_domain_find',
264 'localizable' => FALSE,
266 'sig' => 'civicrm_word_replacement::1::domain_id::find_word',
269 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;