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:104090c38770547ffa491fccdf299765)
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',
128 'name' => 'find_word',
129 'type' => CRM_Utils_Type
::T_STRING
,
130 'title' => ts('Replaced Word'),
131 'description' => ts('Word which need to be replaced'),
133 'size' => CRM_Utils_Type
::HUGE
,
134 'where' => 'civicrm_word_replacement.find_word',
135 'table_name' => 'civicrm_word_replacement',
136 'entity' => 'WordReplacement',
137 'bao' => 'CRM_Core_BAO_WordReplacement',
142 'name' => 'replace_word',
143 'type' => CRM_Utils_Type
::T_STRING
,
144 'title' => ts('Replacement Word'),
145 'description' => ts('Word which will replace the word in find'),
147 'size' => CRM_Utils_Type
::HUGE
,
148 'where' => 'civicrm_word_replacement.replace_word',
149 'table_name' => 'civicrm_word_replacement',
150 'entity' => 'WordReplacement',
151 'bao' => 'CRM_Core_BAO_WordReplacement',
156 'name' => 'is_active',
157 'type' => CRM_Utils_Type
::T_BOOLEAN
,
158 'title' => ts('Word Replacement is Active'),
159 'description' => ts('Is this entry active?'),
160 'where' => 'civicrm_word_replacement.is_active',
162 'table_name' => 'civicrm_word_replacement',
163 'entity' => 'WordReplacement',
164 'bao' => 'CRM_Core_BAO_WordReplacement',
169 'name' => 'match_type',
170 'type' => CRM_Utils_Type
::T_STRING
,
171 'title' => ts('Word Replacement Match Type'),
173 'size' => CRM_Utils_Type
::TWELVE
,
174 'where' => 'civicrm_word_replacement.match_type',
175 'default' => 'wildcardMatch',
176 'table_name' => 'civicrm_word_replacement',
177 'entity' => 'WordReplacement',
178 'bao' => 'CRM_Core_BAO_WordReplacement',
183 'pseudoconstant' => [
184 'callback' => 'CRM_Core_SelectValues::getWordReplacementMatchType',
189 'name' => 'domain_id',
190 'type' => CRM_Utils_Type
::T_INT
,
191 'title' => ts('Word Replacement Domain ID'),
192 'description' => ts('FK to Domain ID. This is for Domain specific word replacement'),
193 'where' => 'civicrm_word_replacement.domain_id',
194 'table_name' => 'civicrm_word_replacement',
195 'entity' => 'WordReplacement',
196 'bao' => 'CRM_Core_BAO_WordReplacement',
198 'FKClassName' => 'CRM_Core_DAO_Domain',
199 'pseudoconstant' => [
200 'table' => 'civicrm_domain',
202 'labelColumn' => 'name',
207 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
209 return Civi
::$statics[__CLASS__
]['fields'];
213 * Return a mapping from field-name to the corresponding key (as used in fields()).
216 * Array(string $name => string $uniqueName).
218 public static function &fieldKeys() {
219 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
220 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
222 return Civi
::$statics[__CLASS__
]['fieldKeys'];
226 * Returns the names of this table
230 public static function getTableName() {
231 return self
::$_tableName;
235 * Returns if this table needs to be logged
239 public function getLog() {
244 * Returns the list of fields that can be imported
246 * @param bool $prefix
250 public static function &import($prefix = FALSE) {
251 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'word_replacement', $prefix, []);
256 * Returns the list of fields that can be exported
258 * @param bool $prefix
262 public static function &export($prefix = FALSE) {
263 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'word_replacement', $prefix, []);
268 * Returns the list of indices
270 * @param bool $localize
274 public static function indices($localize = TRUE) {
276 'UI_domain_find' => [
277 'name' => 'UI_domain_find',
282 'localizable' => FALSE,
284 'sig' => 'civicrm_word_replacement::1::domain_id::find_word',
287 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;