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:4465ed4733f5b424c231d208ef1f61d7)
13 * Database access object for the WordReplacement entity.
15 class CRM_Core_DAO_WordReplacement
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '4.4';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_word_replacement';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
41 * Word which need to be replaced
48 * Word which will replace the word in find
55 * Is this entry active?
67 * FK to Domain ID. This is for Domain specific word replacement
76 public function __construct() {
77 $this->__table
= 'civicrm_word_replacement';
78 parent
::__construct();
82 * Returns localized title of this entity.
85 * Whether to return the plural version of the title.
87 public static function getEntityTitle($plural = FALSE) {
88 return $plural ?
ts('Word Replacements') : ts('Word Replacement');
92 * Returns foreign keys and entity references.
95 * [CRM_Core_Reference_Interface]
97 public static function getReferenceColumns() {
98 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
99 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
100 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
101 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
103 return Civi
::$statics[__CLASS__
]['links'];
107 * Returns all the column names of this table
111 public static function &fields() {
112 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
113 Civi
::$statics[__CLASS__
]['fields'] = [
116 'type' => CRM_Utils_Type
::T_INT
,
117 'title' => ts('Word Replacement ID'),
118 'description' => ts('Word replacement ID'),
120 'where' => 'civicrm_word_replacement.id',
121 'table_name' => 'civicrm_word_replacement',
122 'entity' => 'WordReplacement',
123 'bao' => 'CRM_Core_BAO_WordReplacement',
132 'name' => 'find_word',
133 'type' => CRM_Utils_Type
::T_STRING
,
134 'title' => ts('Replaced Word'),
135 'description' => ts('Word which need to be replaced'),
137 'size' => CRM_Utils_Type
::HUGE
,
138 'where' => 'civicrm_word_replacement.find_word',
139 'table_name' => 'civicrm_word_replacement',
140 'entity' => 'WordReplacement',
141 'bao' => 'CRM_Core_BAO_WordReplacement',
146 'name' => 'replace_word',
147 'type' => CRM_Utils_Type
::T_STRING
,
148 'title' => ts('Replacement Word'),
149 'description' => ts('Word which will replace the word in find'),
151 'size' => CRM_Utils_Type
::HUGE
,
152 'where' => 'civicrm_word_replacement.replace_word',
153 'table_name' => 'civicrm_word_replacement',
154 'entity' => 'WordReplacement',
155 'bao' => 'CRM_Core_BAO_WordReplacement',
160 'name' => 'is_active',
161 'type' => CRM_Utils_Type
::T_BOOLEAN
,
162 'title' => ts('Word Replacement is Active'),
163 'description' => ts('Is this entry active?'),
164 'where' => 'civicrm_word_replacement.is_active',
166 'table_name' => 'civicrm_word_replacement',
167 'entity' => 'WordReplacement',
168 'bao' => 'CRM_Core_BAO_WordReplacement',
173 'name' => 'match_type',
174 'type' => CRM_Utils_Type
::T_STRING
,
175 'title' => ts('Word Replacement Match Type'),
177 'size' => CRM_Utils_Type
::TWELVE
,
178 'where' => 'civicrm_word_replacement.match_type',
179 'default' => 'wildcardMatch',
180 'table_name' => 'civicrm_word_replacement',
181 'entity' => 'WordReplacement',
182 'bao' => 'CRM_Core_BAO_WordReplacement',
187 'pseudoconstant' => [
188 'callback' => 'CRM_Core_SelectValues::getWordReplacementMatchType',
193 'name' => 'domain_id',
194 'type' => CRM_Utils_Type
::T_INT
,
195 'title' => ts('Domain ID'),
196 'description' => ts('FK to Domain ID. This is for Domain specific word replacement'),
197 'where' => 'civicrm_word_replacement.domain_id',
198 'table_name' => 'civicrm_word_replacement',
199 'entity' => 'WordReplacement',
200 'bao' => 'CRM_Core_BAO_WordReplacement',
202 'FKClassName' => 'CRM_Core_DAO_Domain',
204 'label' => ts("Domain"),
206 'pseudoconstant' => [
207 'table' => 'civicrm_domain',
209 'labelColumn' => 'name',
214 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
216 return Civi
::$statics[__CLASS__
]['fields'];
220 * Return a mapping from field-name to the corresponding key (as used in fields()).
223 * Array(string $name => string $uniqueName).
225 public static function &fieldKeys() {
226 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
227 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
229 return Civi
::$statics[__CLASS__
]['fieldKeys'];
233 * Returns the names of this table
237 public static function getTableName() {
238 return self
::$_tableName;
242 * Returns if this table needs to be logged
246 public function getLog() {
251 * Returns the list of fields that can be imported
253 * @param bool $prefix
257 public static function &import($prefix = FALSE) {
258 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'word_replacement', $prefix, []);
263 * Returns the list of fields that can be exported
265 * @param bool $prefix
269 public static function &export($prefix = FALSE) {
270 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'word_replacement', $prefix, []);
275 * Returns the list of indices
277 * @param bool $localize
281 public static function indices($localize = TRUE) {
283 'UI_domain_find' => [
284 'name' => 'UI_domain_find',
289 'localizable' => FALSE,
291 'sig' => 'civicrm_word_replacement::1::domain_id::find_word',
294 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;