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:870f3b71b12b41ed1e0e59e1ff57b2db)
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 * Field to show when displaying a record.
32 public static $_labelField = 'name';
35 * Should CiviCRM log any modifications to this table in the civicrm_log table.
39 public static $_log = TRUE;
42 * 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
49 * Financial Type Name.
56 * Financial Type Description.
63 * 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.
67 public $is_deductible;
70 * Is this a predefined system object?
77 * Is this property active?
86 public function __construct() {
87 $this->__table
= 'civicrm_financial_type';
88 parent
::__construct();
92 * Returns localized title of this entity.
95 * Whether to return the plural version of the title.
97 public static function getEntityTitle($plural = FALSE) {
98 return $plural ?
ts('Financial Types') : ts('Financial Type');
102 * Returns all the column names of this table
106 public static function &fields() {
107 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
108 Civi
::$statics[__CLASS__
]['fields'] = [
111 'type' => CRM_Utils_Type
::T_INT
,
112 'title' => ts('Financial Type ID'),
113 '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'),
115 'where' => 'civicrm_financial_type.id',
116 'table_name' => 'civicrm_financial_type',
117 'entity' => 'FinancialType',
118 'bao' => 'CRM_Financial_BAO_FinancialType',
122 'financial_type' => [
124 'type' => CRM_Utils_Type
::T_STRING
,
125 'title' => ts('Financial Type'),
126 'description' => ts('Financial Type Name.'),
129 'size' => CRM_Utils_Type
::BIG
,
131 'where' => 'civicrm_financial_type.name',
132 'headerPattern' => '/(finan(cial)?)?type/i',
133 'dataPattern' => '/donation|member|campaign/i',
135 'table_name' => 'civicrm_financial_type',
136 'entity' => 'FinancialType',
137 'bao' => 'CRM_Financial_BAO_FinancialType',
141 'label' => ts("Name"),
146 'name' => 'description',
147 'type' => CRM_Utils_Type
::T_STRING
,
148 'title' => ts('Description'),
149 'description' => ts('Financial Type Description.'),
151 'size' => CRM_Utils_Type
::HUGE
,
152 'where' => 'civicrm_financial_type.description',
153 'table_name' => 'civicrm_financial_type',
154 'entity' => 'FinancialType',
155 'bao' => 'CRM_Financial_BAO_FinancialType',
158 'type' => 'TextArea',
159 'label' => ts("Description"),
164 'name' => 'is_deductible',
165 'type' => CRM_Utils_Type
::T_BOOLEAN
,
166 'title' => ts('Is Tax Deductible?'),
167 '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.'),
169 'where' => 'civicrm_financial_type.is_deductible',
171 'table_name' => 'civicrm_financial_type',
172 'entity' => 'FinancialType',
173 'bao' => 'CRM_Financial_BAO_FinancialType',
176 'type' => 'CheckBox',
177 'label' => ts("Tax-Deductible?"),
182 'name' => 'is_reserved',
183 'type' => CRM_Utils_Type
::T_BOOLEAN
,
184 'title' => ts('Financial Type is Reserved?'),
185 'description' => ts('Is this a predefined system object?'),
187 'where' => 'civicrm_financial_type.is_reserved',
189 'table_name' => 'civicrm_financial_type',
190 'entity' => 'FinancialType',
191 'bao' => 'CRM_Financial_BAO_FinancialType',
194 'type' => 'CheckBox',
195 'label' => ts("Reserved?"),
200 'name' => 'is_active',
201 'type' => CRM_Utils_Type
::T_BOOLEAN
,
202 'title' => ts('Financial Type Is Active?'),
203 'description' => ts('Is this property active?'),
205 'where' => 'civicrm_financial_type.is_active',
207 'table_name' => 'civicrm_financial_type',
208 'entity' => 'FinancialType',
209 'bao' => 'CRM_Financial_BAO_FinancialType',
212 'type' => 'CheckBox',
213 'label' => ts("Enabled?"),
218 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
220 return Civi
::$statics[__CLASS__
]['fields'];
224 * Return a mapping from field-name to the corresponding key (as used in fields()).
227 * Array(string $name => string $uniqueName).
229 public static function &fieldKeys() {
230 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
231 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
233 return Civi
::$statics[__CLASS__
]['fieldKeys'];
237 * Returns the names of this table
241 public static function getTableName() {
242 return self
::$_tableName;
246 * Returns if this table needs to be logged
250 public function getLog() {
255 * Returns the list of fields that can be imported
257 * @param bool $prefix
261 public static function &import($prefix = FALSE) {
262 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'financial_type', $prefix, []);
267 * Returns the list of fields that can be exported
269 * @param bool $prefix
273 public static function &export($prefix = FALSE) {
274 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'financial_type', $prefix, []);
279 * Returns the list of indices
281 * @param bool $localize
285 public static function indices($localize = TRUE) {
292 'localizable' => FALSE,
294 'sig' => 'civicrm_financial_type::1::id',
297 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;