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:9395c8fe3d749ad60136065301a5c44f)
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 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 'where' => 'civicrm_financial_type.id',
96 'table_name' => 'civicrm_financial_type',
97 'entity' => 'FinancialType',
98 'bao' => 'CRM_Financial_BAO_FinancialType',
101 'financial_type' => [
103 'type' => CRM_Utils_Type
::T_STRING
,
104 'title' => ts('Financial Type'),
105 'description' => ts('Financial Type Name.'),
108 'size' => CRM_Utils_Type
::BIG
,
110 'where' => 'civicrm_financial_type.name',
111 'headerPattern' => '/(finan(cial)?)?type/i',
112 'dataPattern' => '/donation|member|campaign/i',
114 'table_name' => 'civicrm_financial_type',
115 'entity' => 'FinancialType',
116 'bao' => 'CRM_Financial_BAO_FinancialType',
120 'label' => ts("Name"),
124 'name' => 'description',
125 'type' => CRM_Utils_Type
::T_STRING
,
126 'title' => ts('Description'),
127 'description' => ts('Financial Type Description.'),
129 'size' => CRM_Utils_Type
::HUGE
,
130 'where' => 'civicrm_financial_type.description',
131 'table_name' => 'civicrm_financial_type',
132 'entity' => 'FinancialType',
133 'bao' => 'CRM_Financial_BAO_FinancialType',
136 'type' => 'TextArea',
137 'label' => ts("Description"),
141 'name' => 'is_deductible',
142 'type' => CRM_Utils_Type
::T_BOOLEAN
,
143 'title' => ts('Is Tax Deductible?'),
144 '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.'),
145 'where' => 'civicrm_financial_type.is_deductible',
147 'table_name' => 'civicrm_financial_type',
148 'entity' => 'FinancialType',
149 'bao' => 'CRM_Financial_BAO_FinancialType',
152 'type' => 'CheckBox',
153 'label' => ts("Tax-Deductible?"),
157 'name' => 'is_reserved',
158 'type' => CRM_Utils_Type
::T_BOOLEAN
,
159 'title' => ts('Financial Type is Reserved?'),
160 'description' => ts('Is this a predefined system object?'),
161 'where' => 'civicrm_financial_type.is_reserved',
162 'table_name' => 'civicrm_financial_type',
163 'entity' => 'FinancialType',
164 'bao' => 'CRM_Financial_BAO_FinancialType',
167 'type' => 'CheckBox',
168 'label' => ts("Reserved?"),
172 'name' => 'is_active',
173 'type' => CRM_Utils_Type
::T_BOOLEAN
,
174 'title' => ts('Financial Type Is Active?'),
175 'description' => ts('Is this property active?'),
176 'where' => 'civicrm_financial_type.is_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;