5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Financial/FinancialType.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:6d85bc0675253407de19ac9226ba4478)
13 * Database access object for the FinancialType entity.
15 class CRM_Financial_DAO_FinancialType
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_financial_type';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 * 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
39 * Financial Type Name.
46 * Financial Type Description.
53 * 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.
57 public $is_deductible;
60 * Is this a predefined system object?
67 * Is this property active?
76 public function __construct() {
77 $this->__table
= 'civicrm_financial_type';
78 parent
::__construct();
82 * Returns all the column names of this table
86 public static function &fields() {
87 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
88 Civi
::$statics[__CLASS__
]['fields'] = [
91 'type' => CRM_Utils_Type
::T_INT
,
92 'title' => ts('Financial Type ID'),
93 'description' => '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',
95 'table_name' => 'civicrm_financial_type',
96 'entity' => 'FinancialType',
97 'bao' => 'CRM_Financial_BAO_FinancialType',
100 'financial_type' => [
102 'type' => CRM_Utils_Type
::T_STRING
,
103 'title' => ts('Financial Type'),
104 'description' => 'Financial Type Name.',
107 'size' => CRM_Utils_Type
::BIG
,
109 'where' => 'civicrm_financial_type.name',
110 'headerPattern' => '/(finan(cial)?)?type/i',
111 'dataPattern' => '/donation|member|campaign/i',
113 'table_name' => 'civicrm_financial_type',
114 'entity' => 'FinancialType',
115 'bao' => 'CRM_Financial_BAO_FinancialType',
119 'label' => ts("Name"),
121 'pseudoconstant' => [
122 'table' => 'civicrm_financial_type',
124 'labelColumn' => 'name',
128 'name' => 'description',
129 'type' => CRM_Utils_Type
::T_STRING
,
130 'title' => ts('Description'),
131 'description' => 'Financial Type Description.',
133 'size' => CRM_Utils_Type
::HUGE
,
134 'table_name' => 'civicrm_financial_type',
135 'entity' => 'FinancialType',
136 'bao' => 'CRM_Financial_BAO_FinancialType',
139 'type' => 'TextArea',
140 'label' => ts("Description"),
144 'name' => 'is_deductible',
145 'type' => CRM_Utils_Type
::T_BOOLEAN
,
146 'title' => ts('Is Tax Deductible?'),
147 'description' => '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.',
149 'table_name' => 'civicrm_financial_type',
150 'entity' => 'FinancialType',
151 'bao' => 'CRM_Financial_BAO_FinancialType',
154 'type' => 'CheckBox',
155 'label' => ts("Tax-Deductible?"),
159 'name' => 'is_reserved',
160 'type' => CRM_Utils_Type
::T_BOOLEAN
,
161 'title' => ts('Financial Type is Reserved?'),
162 'description' => 'Is this a predefined system object?',
163 'table_name' => 'civicrm_financial_type',
164 'entity' => 'FinancialType',
165 'bao' => 'CRM_Financial_BAO_FinancialType',
168 'type' => 'CheckBox',
169 'label' => ts("Reserved?"),
173 'name' => 'is_active',
174 'type' => CRM_Utils_Type
::T_BOOLEAN
,
175 'title' => ts('Financial Type Is Active?'),
176 'description' => 'Is this property active?',
177 'table_name' => 'civicrm_financial_type',
178 'entity' => 'FinancialType',
179 'bao' => 'CRM_Financial_BAO_FinancialType',
182 'type' => 'CheckBox',
183 'label' => ts("Enabled?"),
187 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
189 return Civi
::$statics[__CLASS__
]['fields'];
193 * Return a mapping from field-name to the corresponding key (as used in fields()).
196 * Array(string $name => string $uniqueName).
198 public static function &fieldKeys() {
199 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
200 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
202 return Civi
::$statics[__CLASS__
]['fieldKeys'];
206 * Returns the names of this table
210 public static function getTableName() {
211 return self
::$_tableName;
215 * Returns if this table needs to be logged
219 public function getLog() {
224 * Returns the list of fields that can be imported
226 * @param bool $prefix
230 public static function &import($prefix = FALSE) {
231 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'financial_type', $prefix, []);
236 * Returns the list of fields that can be exported
238 * @param bool $prefix
242 public static function &export($prefix = FALSE) {
243 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'financial_type', $prefix, []);
248 * Returns the list of indices
250 * @param bool $localize
254 public static function indices($localize = TRUE) {
261 'localizable' => FALSE,
263 'sig' => 'civicrm_financial_type::1::id',
266 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;