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:c5865289b55e3bdbca5fbca82a61526b)
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;
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
43 * Word which need to be replaced
46 * (SQL type: varchar(255))
47 * Note that values will be retrieved from the database as a string.
52 * Word which will replace the word in find
55 * (SQL type: varchar(255))
56 * Note that values will be retrieved from the database as a string.
61 * Is this entry active?
65 * Note that values will be retrieved from the database as a string.
71 * (SQL type: varchar(16))
72 * Note that values will be retrieved from the database as a string.
77 * FK to Domain ID. This is for Domain specific word replacement
79 * @var int|string|null
80 * (SQL type: int unsigned)
81 * Note that values will be retrieved from the database as a string.
88 public function __construct() {
89 $this->__table
= 'civicrm_word_replacement';
90 parent
::__construct();
94 * Returns localized title of this entity.
97 * Whether to return the plural version of the title.
99 public static function getEntityTitle($plural = FALSE) {
100 return $plural ?
ts('Word Replacements') : ts('Word Replacement');
104 * Returns foreign keys and entity references.
107 * [CRM_Core_Reference_Interface]
109 public static function getReferenceColumns() {
110 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
111 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
112 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
113 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
115 return Civi
::$statics[__CLASS__
]['links'];
119 * Returns all the column names of this table
123 public static function &fields() {
124 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
125 Civi
::$statics[__CLASS__
]['fields'] = [
128 'type' => CRM_Utils_Type
::T_INT
,
129 'title' => ts('Word Replacement ID'),
130 'description' => ts('Word replacement ID'),
132 'where' => 'civicrm_word_replacement.id',
133 'table_name' => 'civicrm_word_replacement',
134 'entity' => 'WordReplacement',
135 'bao' => 'CRM_Core_BAO_WordReplacement',
144 'name' => 'find_word',
145 'type' => CRM_Utils_Type
::T_STRING
,
146 'title' => ts('Replaced Word'),
147 'description' => ts('Word which need to be replaced'),
149 'size' => CRM_Utils_Type
::HUGE
,
150 'where' => 'civicrm_word_replacement.find_word',
151 'table_name' => 'civicrm_word_replacement',
152 'entity' => 'WordReplacement',
153 'bao' => 'CRM_Core_BAO_WordReplacement',
158 'name' => 'replace_word',
159 'type' => CRM_Utils_Type
::T_STRING
,
160 'title' => ts('Replacement Word'),
161 'description' => ts('Word which will replace the word in find'),
163 'size' => CRM_Utils_Type
::HUGE
,
164 'where' => 'civicrm_word_replacement.replace_word',
165 'table_name' => 'civicrm_word_replacement',
166 'entity' => 'WordReplacement',
167 'bao' => 'CRM_Core_BAO_WordReplacement',
172 'name' => 'is_active',
173 'type' => CRM_Utils_Type
::T_BOOLEAN
,
174 'title' => ts('Word Replacement is Active'),
175 'description' => ts('Is this entry active?'),
177 'where' => 'civicrm_word_replacement.is_active',
179 'table_name' => 'civicrm_word_replacement',
180 'entity' => 'WordReplacement',
181 'bao' => 'CRM_Core_BAO_WordReplacement',
186 'name' => 'match_type',
187 'type' => CRM_Utils_Type
::T_STRING
,
188 'title' => ts('Word Replacement Match Type'),
190 'size' => CRM_Utils_Type
::TWELVE
,
191 'where' => 'civicrm_word_replacement.match_type',
192 'default' => 'wildcardMatch',
193 'table_name' => 'civicrm_word_replacement',
194 'entity' => 'WordReplacement',
195 'bao' => 'CRM_Core_BAO_WordReplacement',
200 'pseudoconstant' => [
201 'callback' => 'CRM_Core_SelectValues::getWordReplacementMatchType',
206 'name' => 'domain_id',
207 'type' => CRM_Utils_Type
::T_INT
,
208 'title' => ts('Domain ID'),
209 'description' => ts('FK to Domain ID. This is for Domain specific word replacement'),
210 'where' => 'civicrm_word_replacement.domain_id',
211 'table_name' => 'civicrm_word_replacement',
212 'entity' => 'WordReplacement',
213 'bao' => 'CRM_Core_BAO_WordReplacement',
215 'FKClassName' => 'CRM_Core_DAO_Domain',
217 'label' => ts("Domain"),
219 'pseudoconstant' => [
220 'table' => 'civicrm_domain',
222 'labelColumn' => 'name',
227 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
229 return Civi
::$statics[__CLASS__
]['fields'];
233 * Return a mapping from field-name to the corresponding key (as used in fields()).
236 * Array(string $name => string $uniqueName).
238 public static function &fieldKeys() {
239 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
240 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
242 return Civi
::$statics[__CLASS__
]['fieldKeys'];
246 * Returns the names of this table
250 public static function getTableName() {
251 return self
::$_tableName;
255 * Returns if this table needs to be logged
259 public function getLog() {
264 * Returns the list of fields that can be imported
266 * @param bool $prefix
270 public static function &import($prefix = FALSE) {
271 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'word_replacement', $prefix, []);
276 * Returns the list of fields that can be exported
278 * @param bool $prefix
282 public static function &export($prefix = FALSE) {
283 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'word_replacement', $prefix, []);
288 * Returns the list of indices
290 * @param bool $localize
294 public static function indices($localize = TRUE) {
296 'UI_domain_find' => [
297 'name' => 'UI_domain_find',
302 'localizable' => FALSE,
304 'sig' => 'civicrm_word_replacement::1::domain_id::find_word',
307 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;