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:7c49ce3c9b6ec6cebff0413535928cbf)
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',
122 'name' => 'find_word',
123 'type' => CRM_Utils_Type
::T_STRING
,
124 'title' => ts('Replaced Word'),
125 'description' => ts('Word which need to be replaced'),
127 'size' => CRM_Utils_Type
::HUGE
,
128 'where' => 'civicrm_word_replacement.find_word',
129 'table_name' => 'civicrm_word_replacement',
130 'entity' => 'WordReplacement',
131 'bao' => 'CRM_Core_BAO_WordReplacement',
135 'name' => 'replace_word',
136 'type' => CRM_Utils_Type
::T_STRING
,
137 'title' => ts('Replacement Word'),
138 'description' => ts('Word which will replace the word in find'),
140 'size' => CRM_Utils_Type
::HUGE
,
141 'where' => 'civicrm_word_replacement.replace_word',
142 'table_name' => 'civicrm_word_replacement',
143 'entity' => 'WordReplacement',
144 'bao' => 'CRM_Core_BAO_WordReplacement',
148 'name' => 'is_active',
149 'type' => CRM_Utils_Type
::T_BOOLEAN
,
150 'title' => ts('Word Replacement is Active'),
151 'description' => ts('Is this entry active?'),
152 'where' => 'civicrm_word_replacement.is_active',
154 'table_name' => 'civicrm_word_replacement',
155 'entity' => 'WordReplacement',
156 'bao' => 'CRM_Core_BAO_WordReplacement',
160 'name' => 'match_type',
161 'type' => CRM_Utils_Type
::T_STRING
,
162 'title' => ts('Word Replacement Match Type'),
164 'size' => CRM_Utils_Type
::TWELVE
,
165 'where' => 'civicrm_word_replacement.match_type',
166 'default' => 'wildcardMatch',
167 'table_name' => 'civicrm_word_replacement',
168 'entity' => 'WordReplacement',
169 'bao' => 'CRM_Core_BAO_WordReplacement',
174 'pseudoconstant' => [
175 'callback' => 'CRM_Core_SelectValues::getWordReplacementMatchType',
179 'name' => 'domain_id',
180 'type' => CRM_Utils_Type
::T_INT
,
181 'title' => ts('Word Replacement Domain ID'),
182 'description' => ts('FK to Domain ID. This is for Domain specific word replacement'),
183 'where' => 'civicrm_word_replacement.domain_id',
184 'table_name' => 'civicrm_word_replacement',
185 'entity' => 'WordReplacement',
186 'bao' => 'CRM_Core_BAO_WordReplacement',
188 'FKClassName' => 'CRM_Core_DAO_Domain',
189 'pseudoconstant' => [
190 'table' => 'civicrm_domain',
192 'labelColumn' => 'name',
196 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
198 return Civi
::$statics[__CLASS__
]['fields'];
202 * Return a mapping from field-name to the corresponding key (as used in fields()).
205 * Array(string $name => string $uniqueName).
207 public static function &fieldKeys() {
208 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
209 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
211 return Civi
::$statics[__CLASS__
]['fieldKeys'];
215 * Returns the names of this table
219 public static function getTableName() {
220 return self
::$_tableName;
224 * Returns if this table needs to be logged
228 public function getLog() {
233 * Returns the list of fields that can be imported
235 * @param bool $prefix
239 public static function &import($prefix = FALSE) {
240 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'word_replacement', $prefix, []);
245 * Returns the list of fields that can be exported
247 * @param bool $prefix
251 public static function &export($prefix = FALSE) {
252 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'word_replacement', $prefix, []);
257 * Returns the list of indices
259 * @param bool $localize
263 public static function indices($localize = TRUE) {
265 'UI_domain_find' => [
266 'name' => 'UI_domain_find',
271 'localizable' => FALSE,
273 'sig' => 'civicrm_word_replacement::1::domain_id::find_word',
276 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;