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:36875c58b3267bdc2def295713858868)
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';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_financial_type';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = TRUE;
34 * 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
41 * Financial Type Name.
48 * Financial Type Description.
55 * 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.
59 public $is_deductible;
62 * Is this a predefined system object?
69 * Is this property active?
78 public function __construct() {
79 $this->__table
= 'civicrm_financial_type';
80 parent
::__construct();
84 * Returns localized title of this entity.
87 * Whether to return the plural version of the title.
89 public static function getEntityTitle($plural = FALSE) {
90 return $plural ?
ts('Financial Types') : ts('Financial Type');
94 * Returns all the column names of this table
98 public static function &fields() {
99 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
100 Civi
::$statics[__CLASS__
]['fields'] = [
103 'type' => CRM_Utils_Type
::T_INT
,
104 'title' => ts('Financial Type ID'),
105 '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'),
107 'where' => 'civicrm_financial_type.id',
108 'table_name' => 'civicrm_financial_type',
109 'entity' => 'FinancialType',
110 'bao' => 'CRM_Financial_BAO_FinancialType',
114 'financial_type' => [
116 'type' => CRM_Utils_Type
::T_STRING
,
117 'title' => ts('Financial Type'),
118 'description' => ts('Financial Type Name.'),
121 'size' => CRM_Utils_Type
::BIG
,
123 'where' => 'civicrm_financial_type.name',
124 'headerPattern' => '/(finan(cial)?)?type/i',
125 'dataPattern' => '/donation|member|campaign/i',
127 'table_name' => 'civicrm_financial_type',
128 'entity' => 'FinancialType',
129 'bao' => 'CRM_Financial_BAO_FinancialType',
133 'label' => ts("Name"),
138 'name' => 'description',
139 'type' => CRM_Utils_Type
::T_STRING
,
140 'title' => ts('Description'),
141 'description' => ts('Financial Type Description.'),
143 'size' => CRM_Utils_Type
::HUGE
,
144 'where' => 'civicrm_financial_type.description',
145 'table_name' => 'civicrm_financial_type',
146 'entity' => 'FinancialType',
147 'bao' => 'CRM_Financial_BAO_FinancialType',
150 'type' => 'TextArea',
151 'label' => ts("Description"),
156 'name' => 'is_deductible',
157 'type' => CRM_Utils_Type
::T_BOOLEAN
,
158 'title' => ts('Is Tax Deductible?'),
159 '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.'),
160 'where' => 'civicrm_financial_type.is_deductible',
162 'table_name' => 'civicrm_financial_type',
163 'entity' => 'FinancialType',
164 'bao' => 'CRM_Financial_BAO_FinancialType',
167 'type' => 'CheckBox',
168 'label' => ts("Tax-Deductible?"),
173 'name' => 'is_reserved',
174 'type' => CRM_Utils_Type
::T_BOOLEAN
,
175 'title' => ts('Financial Type is Reserved?'),
176 'description' => ts('Is this a predefined system object?'),
177 'where' => 'civicrm_financial_type.is_reserved',
178 'table_name' => 'civicrm_financial_type',
179 'entity' => 'FinancialType',
180 'bao' => 'CRM_Financial_BAO_FinancialType',
183 'type' => 'CheckBox',
184 'label' => ts("Reserved?"),
189 'name' => 'is_active',
190 'type' => CRM_Utils_Type
::T_BOOLEAN
,
191 'title' => ts('Financial Type Is Active?'),
192 'description' => ts('Is this property active?'),
193 'where' => 'civicrm_financial_type.is_active',
194 'table_name' => 'civicrm_financial_type',
195 'entity' => 'FinancialType',
196 'bao' => 'CRM_Financial_BAO_FinancialType',
199 'type' => 'CheckBox',
200 'label' => ts("Enabled?"),
205 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
207 return Civi
::$statics[__CLASS__
]['fields'];
211 * Return a mapping from field-name to the corresponding key (as used in fields()).
214 * Array(string $name => string $uniqueName).
216 public static function &fieldKeys() {
217 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
218 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
220 return Civi
::$statics[__CLASS__
]['fieldKeys'];
224 * Returns the names of this table
228 public static function getTableName() {
229 return self
::$_tableName;
233 * Returns if this table needs to be logged
237 public function getLog() {
242 * Returns the list of fields that can be imported
244 * @param bool $prefix
248 public static function &import($prefix = FALSE) {
249 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'financial_type', $prefix, []);
254 * Returns the list of fields that can be exported
256 * @param bool $prefix
260 public static function &export($prefix = FALSE) {
261 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'financial_type', $prefix, []);
266 * Returns the list of indices
268 * @param bool $localize
272 public static function indices($localize = TRUE) {
279 'localizable' => FALSE,
281 'sig' => 'civicrm_financial_type::1::id',
284 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;