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:9ee373312e38ce1a53603685cb99724c)
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 public static $_tableName = 'civicrm_financial_type';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
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 localized title of this entity.
84 public static function getEntityTitle() {
85 return ts('Financial Types');
89 * Returns all the column names of this table
93 public static function &fields() {
94 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
95 Civi
::$statics[__CLASS__
]['fields'] = [
98 'type' => CRM_Utils_Type
::T_INT
,
99 'title' => ts('Financial Type ID'),
100 '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'),
102 'where' => 'civicrm_financial_type.id',
103 'table_name' => 'civicrm_financial_type',
104 'entity' => 'FinancialType',
105 'bao' => 'CRM_Financial_BAO_FinancialType',
108 'financial_type' => [
110 'type' => CRM_Utils_Type
::T_STRING
,
111 'title' => ts('Financial Type'),
112 'description' => ts('Financial Type Name.'),
115 'size' => CRM_Utils_Type
::BIG
,
117 'where' => 'civicrm_financial_type.name',
118 'headerPattern' => '/(finan(cial)?)?type/i',
119 'dataPattern' => '/donation|member|campaign/i',
121 'table_name' => 'civicrm_financial_type',
122 'entity' => 'FinancialType',
123 'bao' => 'CRM_Financial_BAO_FinancialType',
127 'label' => ts("Name"),
131 'name' => 'description',
132 'type' => CRM_Utils_Type
::T_STRING
,
133 'title' => ts('Description'),
134 'description' => ts('Financial Type Description.'),
136 'size' => CRM_Utils_Type
::HUGE
,
137 'where' => 'civicrm_financial_type.description',
138 'table_name' => 'civicrm_financial_type',
139 'entity' => 'FinancialType',
140 'bao' => 'CRM_Financial_BAO_FinancialType',
143 'type' => 'TextArea',
144 'label' => ts("Description"),
148 'name' => 'is_deductible',
149 'type' => CRM_Utils_Type
::T_BOOLEAN
,
150 'title' => ts('Is Tax Deductible?'),
151 '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.'),
152 'where' => 'civicrm_financial_type.is_deductible',
154 'table_name' => 'civicrm_financial_type',
155 'entity' => 'FinancialType',
156 'bao' => 'CRM_Financial_BAO_FinancialType',
159 'type' => 'CheckBox',
160 'label' => ts("Tax-Deductible?"),
164 'name' => 'is_reserved',
165 'type' => CRM_Utils_Type
::T_BOOLEAN
,
166 'title' => ts('Financial Type is Reserved?'),
167 'description' => ts('Is this a predefined system object?'),
168 'where' => 'civicrm_financial_type.is_reserved',
169 'table_name' => 'civicrm_financial_type',
170 'entity' => 'FinancialType',
171 'bao' => 'CRM_Financial_BAO_FinancialType',
174 'type' => 'CheckBox',
175 'label' => ts("Reserved?"),
179 'name' => 'is_active',
180 'type' => CRM_Utils_Type
::T_BOOLEAN
,
181 'title' => ts('Financial Type Is Active?'),
182 'description' => ts('Is this property active?'),
183 'where' => 'civicrm_financial_type.is_active',
184 'table_name' => 'civicrm_financial_type',
185 'entity' => 'FinancialType',
186 'bao' => 'CRM_Financial_BAO_FinancialType',
189 'type' => 'CheckBox',
190 'label' => ts("Enabled?"),
194 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
196 return Civi
::$statics[__CLASS__
]['fields'];
200 * Return a mapping from field-name to the corresponding key (as used in fields()).
203 * Array(string $name => string $uniqueName).
205 public static function &fieldKeys() {
206 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
207 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
209 return Civi
::$statics[__CLASS__
]['fieldKeys'];
213 * Returns the names of this table
217 public static function getTableName() {
218 return self
::$_tableName;
222 * Returns if this table needs to be logged
226 public function getLog() {
231 * Returns the list of fields that can be imported
233 * @param bool $prefix
237 public static function &import($prefix = FALSE) {
238 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'financial_type', $prefix, []);
243 * Returns the list of fields that can be exported
245 * @param bool $prefix
249 public static function &export($prefix = FALSE) {
250 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'financial_type', $prefix, []);
255 * Returns the list of indices
257 * @param bool $localize
261 public static function indices($localize = TRUE) {
268 'localizable' => FALSE,
270 'sig' => 'civicrm_financial_type::1::id',
273 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;