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:ddbf4faec2a77ef3fa7b9d126c9d0443)
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 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = TRUE;
35 * 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
42 * Financial Type Name.
49 * Financial Type Description.
56 * 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.
60 public $is_deductible;
63 * Is this a predefined system object?
70 * Is this property active?
79 public function __construct() {
80 $this->__table
= 'civicrm_financial_type';
81 parent
::__construct();
85 * Returns localized title of this entity.
88 * Whether to return the plural version of the title.
90 public static function getEntityTitle($plural = FALSE) {
91 return $plural ?
ts('Financial Types') : ts('Financial Type');
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('Financial Type ID'),
106 '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'),
108 'where' => 'civicrm_financial_type.id',
109 'table_name' => 'civicrm_financial_type',
110 'entity' => 'FinancialType',
111 'bao' => 'CRM_Financial_BAO_FinancialType',
115 'financial_type' => [
117 'type' => CRM_Utils_Type
::T_STRING
,
118 'title' => ts('Financial Type'),
119 'description' => ts('Financial Type Name.'),
122 'size' => CRM_Utils_Type
::BIG
,
124 'where' => 'civicrm_financial_type.name',
125 'headerPattern' => '/(finan(cial)?)?type/i',
126 'dataPattern' => '/donation|member|campaign/i',
128 'table_name' => 'civicrm_financial_type',
129 'entity' => 'FinancialType',
130 'bao' => 'CRM_Financial_BAO_FinancialType',
134 'label' => ts("Name"),
139 'name' => 'description',
140 'type' => CRM_Utils_Type
::T_STRING
,
141 'title' => ts('Description'),
142 'description' => ts('Financial Type Description.'),
144 'size' => CRM_Utils_Type
::HUGE
,
145 'where' => 'civicrm_financial_type.description',
146 'table_name' => 'civicrm_financial_type',
147 'entity' => 'FinancialType',
148 'bao' => 'CRM_Financial_BAO_FinancialType',
151 'type' => 'TextArea',
152 'label' => ts("Description"),
157 'name' => 'is_deductible',
158 'type' => CRM_Utils_Type
::T_BOOLEAN
,
159 'title' => ts('Is Tax Deductible?'),
160 '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.'),
162 'where' => 'civicrm_financial_type.is_deductible',
164 'table_name' => 'civicrm_financial_type',
165 'entity' => 'FinancialType',
166 'bao' => 'CRM_Financial_BAO_FinancialType',
169 'type' => 'CheckBox',
170 'label' => ts("Tax-Deductible?"),
175 'name' => 'is_reserved',
176 'type' => CRM_Utils_Type
::T_BOOLEAN
,
177 'title' => ts('Financial Type is Reserved?'),
178 'description' => ts('Is this a predefined system object?'),
180 'where' => 'civicrm_financial_type.is_reserved',
182 'table_name' => 'civicrm_financial_type',
183 'entity' => 'FinancialType',
184 'bao' => 'CRM_Financial_BAO_FinancialType',
187 'type' => 'CheckBox',
188 'label' => ts("Reserved?"),
193 'name' => 'is_active',
194 'type' => CRM_Utils_Type
::T_BOOLEAN
,
195 'title' => ts('Financial Type Is Active?'),
196 'description' => ts('Is this property active?'),
198 'where' => 'civicrm_financial_type.is_active',
200 'table_name' => 'civicrm_financial_type',
201 'entity' => 'FinancialType',
202 'bao' => 'CRM_Financial_BAO_FinancialType',
205 'type' => 'CheckBox',
206 'label' => ts("Enabled?"),
211 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
213 return Civi
::$statics[__CLASS__
]['fields'];
217 * Return a mapping from field-name to the corresponding key (as used in fields()).
220 * Array(string $name => string $uniqueName).
222 public static function &fieldKeys() {
223 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
224 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
226 return Civi
::$statics[__CLASS__
]['fieldKeys'];
230 * Returns the names of this table
234 public static function getTableName() {
235 return self
::$_tableName;
239 * Returns if this table needs to be logged
243 public function getLog() {
248 * Returns the list of fields that can be imported
250 * @param bool $prefix
254 public static function &import($prefix = FALSE) {
255 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'financial_type', $prefix, []);
260 * Returns the list of fields that can be exported
262 * @param bool $prefix
266 public static function &export($prefix = FALSE) {
267 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'financial_type', $prefix, []);
272 * Returns the list of indices
274 * @param bool $localize
278 public static function indices($localize = TRUE) {
285 'localizable' => FALSE,
287 'sig' => 'civicrm_financial_type::1::id',
290 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;