5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Core/WordReplacement.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:df2cde8fb1f65a25db724d35387a1342)
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 static $_tableName = 'civicrm_word_replacement';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 foreign keys and entity references.
83 * [CRM_Core_Reference_Interface]
85 public static function getReferenceColumns() {
86 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
87 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
88 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
89 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
91 return Civi
::$statics[__CLASS__
]['links'];
95 * Returns all the column names of this table
99 public static function &fields() {
100 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
101 Civi
::$statics[__CLASS__
]['fields'] = [
104 'type' => CRM_Utils_Type
::T_INT
,
105 'title' => ts('Word Replacement ID'),
106 'description' => ts('Word replacement ID'),
108 'table_name' => 'civicrm_word_replacement',
109 'entity' => 'WordReplacement',
110 'bao' => 'CRM_Core_BAO_WordReplacement',
114 'name' => 'find_word',
115 'type' => CRM_Utils_Type
::T_STRING
,
116 'title' => ts('Replaced Word'),
117 'description' => ts('Word which need to be replaced'),
119 'size' => CRM_Utils_Type
::HUGE
,
120 'table_name' => 'civicrm_word_replacement',
121 'entity' => 'WordReplacement',
122 'bao' => 'CRM_Core_BAO_WordReplacement',
126 'name' => 'replace_word',
127 'type' => CRM_Utils_Type
::T_STRING
,
128 'title' => ts('Replacement Word'),
129 'description' => ts('Word which will replace the word in find'),
131 'size' => CRM_Utils_Type
::HUGE
,
132 'table_name' => 'civicrm_word_replacement',
133 'entity' => 'WordReplacement',
134 'bao' => 'CRM_Core_BAO_WordReplacement',
138 'name' => 'is_active',
139 'type' => CRM_Utils_Type
::T_BOOLEAN
,
140 'title' => ts('Word Replacement is Active'),
141 'description' => ts('Is this entry active?'),
143 'table_name' => 'civicrm_word_replacement',
144 'entity' => 'WordReplacement',
145 'bao' => 'CRM_Core_BAO_WordReplacement',
149 'name' => 'match_type',
150 'type' => CRM_Utils_Type
::T_STRING
,
151 'title' => ts('Word Replacement Match Type'),
153 'size' => CRM_Utils_Type
::TWELVE
,
154 'default' => 'wildcardMatch',
155 'table_name' => 'civicrm_word_replacement',
156 'entity' => 'WordReplacement',
157 'bao' => 'CRM_Core_BAO_WordReplacement',
162 'pseudoconstant' => [
163 'callback' => 'CRM_Core_SelectValues::getWordReplacementMatchType',
167 'name' => 'domain_id',
168 'type' => CRM_Utils_Type
::T_INT
,
169 'title' => ts('Word Replacement Domain ID'),
170 'description' => ts('FK to Domain ID. This is for Domain specific word replacement'),
171 'table_name' => 'civicrm_word_replacement',
172 'entity' => 'WordReplacement',
173 'bao' => 'CRM_Core_BAO_WordReplacement',
175 'FKClassName' => 'CRM_Core_DAO_Domain',
176 'pseudoconstant' => [
177 'table' => 'civicrm_domain',
179 'labelColumn' => 'name',
183 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
185 return Civi
::$statics[__CLASS__
]['fields'];
189 * Return a mapping from field-name to the corresponding key (as used in fields()).
192 * Array(string $name => string $uniqueName).
194 public static function &fieldKeys() {
195 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
196 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
198 return Civi
::$statics[__CLASS__
]['fieldKeys'];
202 * Returns the names of this table
206 public static function getTableName() {
207 return self
::$_tableName;
211 * Returns if this table needs to be logged
215 public function getLog() {
220 * Returns the list of fields that can be imported
222 * @param bool $prefix
226 public static function &import($prefix = FALSE) {
227 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'word_replacement', $prefix, []);
232 * Returns the list of fields that can be exported
234 * @param bool $prefix
238 public static function &export($prefix = FALSE) {
239 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'word_replacement', $prefix, []);
244 * Returns the list of indices
246 * @param bool $localize
250 public static function indices($localize = TRUE) {
252 'UI_domain_find' => [
253 'name' => 'UI_domain_find',
258 'localizable' => FALSE,
260 'sig' => 'civicrm_word_replacement::1::domain_id::find_word',
263 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;