5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Financial/FinancialType.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:035576414ddb721b2607522dc5d874e4)
13 * Database access object for the FinancialType entity.
15 class CRM_Financial_DAO_FinancialType
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.3';
18 const COMPONENT
= 'CiviContribute';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_financial_type';
28 * Field to show when displaying a record.
32 public static $_labelField = 'name';
35 * Should CiviCRM log any modifications to this table in the civicrm_log table.
39 public static $_log = TRUE;
42 * ID of original financial_type so you can search this table by the financial_type.id and then select the relevant version based on the timestamp
49 * Financial Type Name.
56 * Financial Type Description.
63 * Is this financial type tax-deductible? If true, contributions of this type may be fully OR partially deductible - non-deductible amount is stored in the Contribution record.
67 public $is_deductible;
70 * Is this a predefined system object?
77 * Is this property active?
86 public function __construct() {
87 $this->__table
= 'civicrm_financial_type';
88 parent
::__construct();
92 * Returns localized title of this entity.
95 * Whether to return the plural version of the title.
97 public static function getEntityTitle($plural = FALSE) {
98 return $plural ?
ts('Financial Types') : ts('Financial Type');
102 * Returns all the column names of this table
106 public static function &fields() {
107 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
108 Civi
::$statics[__CLASS__
]['fields'] = [
111 'type' => CRM_Utils_Type
::T_INT
,
112 'title' => ts('Financial Type ID'),
113 'description' => ts('ID of original financial_type so you can search this table by the financial_type.id and then select the relevant version based on the timestamp'),
115 'where' => 'civicrm_financial_type.id',
116 'table_name' => 'civicrm_financial_type',
117 'entity' => 'FinancialType',
118 'bao' => 'CRM_Financial_BAO_FinancialType',
126 'financial_type' => [
128 'type' => CRM_Utils_Type
::T_STRING
,
129 'title' => ts('Financial Type'),
130 'description' => ts('Financial Type Name.'),
133 'size' => CRM_Utils_Type
::BIG
,
135 'where' => 'civicrm_financial_type.name',
136 'headerPattern' => '/(finan(cial)?)?type/i',
137 'dataPattern' => '/donation|member|campaign/i',
139 'table_name' => 'civicrm_financial_type',
140 'entity' => 'FinancialType',
141 'bao' => 'CRM_Financial_BAO_FinancialType',
145 'label' => ts("Name"),
150 'name' => 'description',
151 'type' => CRM_Utils_Type
::T_STRING
,
152 'title' => ts('Description'),
153 'description' => ts('Financial Type Description.'),
155 'size' => CRM_Utils_Type
::HUGE
,
156 'where' => 'civicrm_financial_type.description',
157 'table_name' => 'civicrm_financial_type',
158 'entity' => 'FinancialType',
159 'bao' => 'CRM_Financial_BAO_FinancialType',
162 'type' => 'TextArea',
163 'label' => ts("Description"),
168 'name' => 'is_deductible',
169 'type' => CRM_Utils_Type
::T_BOOLEAN
,
170 'title' => ts('Is Tax Deductible?'),
171 'description' => ts('Is this financial type tax-deductible? If true, contributions of this type may be fully OR partially deductible - non-deductible amount is stored in the Contribution record.'),
173 'where' => 'civicrm_financial_type.is_deductible',
175 'table_name' => 'civicrm_financial_type',
176 'entity' => 'FinancialType',
177 'bao' => 'CRM_Financial_BAO_FinancialType',
180 'type' => 'CheckBox',
181 'label' => ts("Tax-Deductible?"),
186 'name' => 'is_reserved',
187 'type' => CRM_Utils_Type
::T_BOOLEAN
,
188 'title' => ts('Financial Type is Reserved?'),
189 'description' => ts('Is this a predefined system object?'),
191 'where' => 'civicrm_financial_type.is_reserved',
193 'table_name' => 'civicrm_financial_type',
194 'entity' => 'FinancialType',
195 'bao' => 'CRM_Financial_BAO_FinancialType',
198 'type' => 'CheckBox',
199 'label' => ts("Reserved?"),
204 'name' => 'is_active',
205 'type' => CRM_Utils_Type
::T_BOOLEAN
,
206 'title' => ts('Financial Type Is Active?'),
207 'description' => ts('Is this property active?'),
209 'where' => 'civicrm_financial_type.is_active',
211 'table_name' => 'civicrm_financial_type',
212 'entity' => 'FinancialType',
213 'bao' => 'CRM_Financial_BAO_FinancialType',
216 'type' => 'CheckBox',
217 'label' => ts("Enabled?"),
222 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
224 return Civi
::$statics[__CLASS__
]['fields'];
228 * Return a mapping from field-name to the corresponding key (as used in fields()).
231 * Array(string $name => string $uniqueName).
233 public static function &fieldKeys() {
234 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
235 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
237 return Civi
::$statics[__CLASS__
]['fieldKeys'];
241 * Returns the names of this table
245 public static function getTableName() {
246 return self
::$_tableName;
250 * Returns if this table needs to be logged
254 public function getLog() {
259 * Returns the list of fields that can be imported
261 * @param bool $prefix
265 public static function &import($prefix = FALSE) {
266 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'financial_type', $prefix, []);
271 * Returns the list of fields that can be exported
273 * @param bool $prefix
277 public static function &export($prefix = FALSE) {
278 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'financial_type', $prefix, []);
283 * Returns the list of indices
285 * @param bool $localize
289 public static function indices($localize = TRUE) {
291 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;