5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/WordReplacement.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:d7e1414f899a3bcabd20806508741f55)
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 localized title of this entity.
82 public static function getEntityTitle() {
83 return ts('Word Replacements');
87 * Returns foreign keys and entity references.
90 * [CRM_Core_Reference_Interface]
92 public static function getReferenceColumns() {
93 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
94 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
95 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
96 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
98 return Civi
::$statics[__CLASS__
]['links'];
102 * Returns all the column names of this table
106 public static function &fields() {
107 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
108 Civi
::$statics[__CLASS__
]['fields'] = [
111 'type' => CRM_Utils_Type
::T_INT
,
112 'title' => ts('Word Replacement ID'),
113 'description' => ts('Word replacement ID'),
115 'where' => 'civicrm_word_replacement.id',
116 'table_name' => 'civicrm_word_replacement',
117 'entity' => 'WordReplacement',
118 'bao' => 'CRM_Core_BAO_WordReplacement',
123 'name' => 'find_word',
124 'type' => CRM_Utils_Type
::T_STRING
,
125 'title' => ts('Replaced Word'),
126 'description' => ts('Word which need to be replaced'),
128 'size' => CRM_Utils_Type
::HUGE
,
129 'where' => 'civicrm_word_replacement.find_word',
130 'table_name' => 'civicrm_word_replacement',
131 'entity' => 'WordReplacement',
132 'bao' => 'CRM_Core_BAO_WordReplacement',
137 'name' => 'replace_word',
138 'type' => CRM_Utils_Type
::T_STRING
,
139 'title' => ts('Replacement Word'),
140 'description' => ts('Word which will replace the word in find'),
142 'size' => CRM_Utils_Type
::HUGE
,
143 'where' => 'civicrm_word_replacement.replace_word',
144 'table_name' => 'civicrm_word_replacement',
145 'entity' => 'WordReplacement',
146 'bao' => 'CRM_Core_BAO_WordReplacement',
151 'name' => 'is_active',
152 'type' => CRM_Utils_Type
::T_BOOLEAN
,
153 'title' => ts('Word Replacement is Active'),
154 'description' => ts('Is this entry active?'),
155 'where' => 'civicrm_word_replacement.is_active',
157 'table_name' => 'civicrm_word_replacement',
158 'entity' => 'WordReplacement',
159 'bao' => 'CRM_Core_BAO_WordReplacement',
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 'where' => 'civicrm_word_replacement.match_type',
170 'default' => 'wildcardMatch',
171 'table_name' => 'civicrm_word_replacement',
172 'entity' => 'WordReplacement',
173 'bao' => 'CRM_Core_BAO_WordReplacement',
178 'pseudoconstant' => [
179 'callback' => 'CRM_Core_SelectValues::getWordReplacementMatchType',
184 'name' => 'domain_id',
185 'type' => CRM_Utils_Type
::T_INT
,
186 'title' => ts('Word Replacement Domain ID'),
187 'description' => ts('FK to Domain ID. This is for Domain specific word replacement'),
188 'where' => 'civicrm_word_replacement.domain_id',
189 'table_name' => 'civicrm_word_replacement',
190 'entity' => 'WordReplacement',
191 'bao' => 'CRM_Core_BAO_WordReplacement',
193 'FKClassName' => 'CRM_Core_DAO_Domain',
194 'pseudoconstant' => [
195 'table' => 'civicrm_domain',
197 'labelColumn' => 'name',
202 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
204 return Civi
::$statics[__CLASS__
]['fields'];
208 * Return a mapping from field-name to the corresponding key (as used in fields()).
211 * Array(string $name => string $uniqueName).
213 public static function &fieldKeys() {
214 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
215 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
217 return Civi
::$statics[__CLASS__
]['fieldKeys'];
221 * Returns the names of this table
225 public static function getTableName() {
226 return self
::$_tableName;
230 * Returns if this table needs to be logged
234 public function getLog() {
239 * Returns the list of fields that can be imported
241 * @param bool $prefix
245 public static function &import($prefix = FALSE) {
246 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'word_replacement', $prefix, []);
251 * Returns the list of fields that can be exported
253 * @param bool $prefix
257 public static function &export($prefix = FALSE) {
258 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'word_replacement', $prefix, []);
263 * Returns the list of indices
265 * @param bool $localize
269 public static function indices($localize = TRUE) {
271 'UI_domain_find' => [
272 'name' => 'UI_domain_find',
277 'localizable' => FALSE,
279 'sig' => 'civicrm_word_replacement::1::domain_id::find_word',
282 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;