CRM-19130 - xml/templates/dao.tpl - Fire events for fields() and links()
[civicrm-core.git] / CRM / Core / DAO / WordReplacement.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
6| Copyright CiviCRM LLC (c) 2004-2016 |
7+--------------------------------------------------------------------+
8| This file is a part of CiviCRM. |
9| |
10| CiviCRM is free software; you can copy, modify, and distribute it |
11| under the terms of the GNU Affero General Public License |
12| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13| |
14| CiviCRM is distributed in the hope that it will be useful, but |
15| WITHOUT ANY WARRANTY; without even the implied warranty of |
16| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17| See the GNU Affero General Public License for more details. |
18| |
19| You should have received a copy of the GNU Affero General Public |
20| License and the CiviCRM Licensing Exception along |
21| with this program; if not, contact CiviCRM LLC |
22| at info[AT]civicrm[DOT]org. If you have questions about the |
23| GNU Affero General Public License or the licensing of CiviCRM, |
24| see the CiviCRM license FAQ at http://civicrm.org/licensing |
25+--------------------------------------------------------------------+
26*/
27/**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2016
30 *
31 * Generated from xml/schema/CRM/Core/WordReplacement.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
437fafcf 33 * (GenCodeChecksum:92b2139ba33ee66fec3e6bb529af304e)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
37class CRM_Core_DAO_WordReplacement extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_word_replacement';
44 /**
45 * static instance to hold the field values
46 *
47 * @var array
48 */
49 static $_fields = null;
e501603b
TO
50 /**
51 * static instance to hold the FK relationships
52 *
53 * @var string
54 */
55 static $_links = null;
e501603b
TO
56 /**
57 * static value to see if we should log any modifications to
58 * this table in the civicrm_log table
59 *
60 * @var boolean
61 */
62 static $_log = false;
63 /**
64 * Word replacement ID
65 *
66 * @var int unsigned
67 */
68 public $id;
69 /**
70 * Word which need to be replaced
71 *
72 * @var string
73 */
74 public $find_word;
75 /**
76 * Word which will replace the word in find
77 *
78 * @var string
79 */
80 public $replace_word;
81 /**
82 * Is this entry active?
83 *
84 * @var boolean
85 */
86 public $is_active;
87 /**
88 *
89 * @var string
90 */
91 public $match_type;
92 /**
93 * FK to Domain ID. This is for Domain specific word replacement
94 *
95 * @var int unsigned
96 */
97 public $domain_id;
98 /**
99 * class constructor
100 *
101 * @return civicrm_word_replacement
102 */
103 function __construct() {
104 $this->__table = 'civicrm_word_replacement';
105 parent::__construct();
106 }
107 /**
108 * Returns foreign keys and entity references
109 *
110 * @return array
111 * [CRM_Core_Reference_Interface]
112 */
113 static function getReferenceColumns() {
114 if (!self::$_links) {
115 self::$_links = static ::createReferenceColumns(__CLASS__);
116 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id');
117 }
118 return self::$_links;
119 }
120 /**
121 * Returns all the column names of this table
122 *
123 * @return array
124 */
125 static function &fields() {
126 if (!(self::$_fields)) {
127 self::$_fields = array(
128 'id' => array(
129 'name' => 'id',
130 'type' => CRM_Utils_Type::T_INT,
131 'title' => ts('Word Replacement ID') ,
132 'description' => 'Word replacement ID',
133 'required' => true,
134 ) ,
135 'find_word' => array(
136 'name' => 'find_word',
137 'type' => CRM_Utils_Type::T_STRING,
138 'title' => ts('Replaced Word') ,
139 'description' => 'Word which need to be replaced',
140 'maxlength' => 255,
141 'size' => CRM_Utils_Type::HUGE,
142 ) ,
143 'replace_word' => array(
144 'name' => 'replace_word',
145 'type' => CRM_Utils_Type::T_STRING,
146 'title' => ts('Replacement Word') ,
147 'description' => 'Word which will replace the word in find',
148 'maxlength' => 255,
149 'size' => CRM_Utils_Type::HUGE,
150 ) ,
151 'is_active' => array(
152 'name' => 'is_active',
153 'type' => CRM_Utils_Type::T_BOOLEAN,
154 'title' => ts('Word Replacement is Active') ,
155 'description' => 'Is this entry active?',
156 'default' => '1',
157 ) ,
158 'match_type' => array(
159 'name' => 'match_type',
160 'type' => CRM_Utils_Type::T_STRING,
161 'title' => ts('Word Replacement Match Type') ,
162 'maxlength' => 16,
163 'size' => CRM_Utils_Type::TWELVE,
164 'default' => 'wildcardMatch',
165 'html' => array(
166 'type' => 'Select',
167 ) ,
168 'pseudoconstant' => array(
169 'callback' => 'CRM_Core_SelectValues::getWordReplacementMatchType',
170 )
171 ) ,
172 'domain_id' => array(
173 'name' => 'domain_id',
174 'type' => CRM_Utils_Type::T_INT,
175 'title' => ts('Word Replacement Domain ID') ,
176 'description' => 'FK to Domain ID. This is for Domain specific word replacement',
177 'FKClassName' => 'CRM_Core_DAO_Domain',
178 'pseudoconstant' => array(
179 'table' => 'civicrm_domain',
180 'keyColumn' => 'id',
181 'labelColumn' => 'name',
182 )
183 ) ,
184 );
185 }
186 return self::$_fields;
187 }
188 /**
bd8e0b14 189 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
190 *
191 * @return array
bd8e0b14 192 * Array(string $name => string $uniqueName).
e501603b
TO
193 */
194 static function &fieldKeys() {
bd8e0b14
TO
195 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
196 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 197 }
bd8e0b14 198 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
199 }
200 /**
201 * Returns the names of this table
202 *
203 * @return string
204 */
205 static function getTableName() {
206 return self::$_tableName;
207 }
208 /**
209 * Returns if this table needs to be logged
210 *
211 * @return boolean
212 */
213 function getLog() {
214 return self::$_log;
215 }
216 /**
217 * Returns the list of fields that can be imported
218 *
219 * @param bool $prefix
220 *
221 * @return array
222 */
223 static function &import($prefix = false) {
60808919
TO
224 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'word_replacement', $prefix, array());
225 return $r;
e501603b
TO
226 }
227 /**
228 * Returns the list of fields that can be exported
229 *
230 * @param bool $prefix
231 *
232 * @return array
233 */
234 static function &export($prefix = false) {
60808919
TO
235 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'word_replacement', $prefix, array());
236 return $r;
e501603b
TO
237 }
238}