5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Financial/FinancialType.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:760550280aaa0da48232ebdfb11170f9)
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' => 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'),
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' => ts('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"),
123 'name' => 'description',
124 'type' => CRM_Utils_Type
::T_STRING
,
125 'title' => ts('Description'),
126 'description' => ts('Financial Type Description.'),
128 'size' => CRM_Utils_Type
::HUGE
,
129 'table_name' => 'civicrm_financial_type',
130 'entity' => 'FinancialType',
131 'bao' => 'CRM_Financial_BAO_FinancialType',
134 'type' => 'TextArea',
135 'label' => ts("Description"),
139 'name' => 'is_deductible',
140 'type' => CRM_Utils_Type
::T_BOOLEAN
,
141 'title' => ts('Is Tax Deductible?'),
142 '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.'),
144 'table_name' => 'civicrm_financial_type',
145 'entity' => 'FinancialType',
146 'bao' => 'CRM_Financial_BAO_FinancialType',
149 'type' => 'CheckBox',
150 'label' => ts("Tax-Deductible?"),
154 'name' => 'is_reserved',
155 'type' => CRM_Utils_Type
::T_BOOLEAN
,
156 'title' => ts('Financial Type is Reserved?'),
157 'description' => ts('Is this a predefined system object?'),
158 'table_name' => 'civicrm_financial_type',
159 'entity' => 'FinancialType',
160 'bao' => 'CRM_Financial_BAO_FinancialType',
163 'type' => 'CheckBox',
164 'label' => ts("Reserved?"),
168 'name' => 'is_active',
169 'type' => CRM_Utils_Type
::T_BOOLEAN
,
170 'title' => ts('Financial Type Is Active?'),
171 'description' => ts('Is this property active?'),
172 'table_name' => 'civicrm_financial_type',
173 'entity' => 'FinancialType',
174 'bao' => 'CRM_Financial_BAO_FinancialType',
177 'type' => 'CheckBox',
178 'label' => ts("Enabled?"),
182 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
184 return Civi
::$statics[__CLASS__
]['fields'];
188 * Return a mapping from field-name to the corresponding key (as used in fields()).
191 * Array(string $name => string $uniqueName).
193 public static function &fieldKeys() {
194 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
195 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
197 return Civi
::$statics[__CLASS__
]['fieldKeys'];
201 * Returns the names of this table
205 public static function getTableName() {
206 return self
::$_tableName;
210 * Returns if this table needs to be logged
214 public function getLog() {
219 * Returns the list of fields that can be imported
221 * @param bool $prefix
225 public static function &import($prefix = FALSE) {
226 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'financial_type', $prefix, []);
231 * Returns the list of fields that can be exported
233 * @param bool $prefix
237 public static function &export($prefix = FALSE) {
238 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'financial_type', $prefix, []);
243 * Returns the list of indices
245 * @param bool $localize
249 public static function indices($localize = TRUE) {
256 'localizable' => FALSE,
258 'sig' => 'civicrm_financial_type::1::id',
261 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;