5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Financial/FinancialType.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:9d787931917508983d68631821eea721)
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' => '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' => '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 'name' => 'description',
120 'type' => CRM_Utils_Type
::T_STRING
,
121 'title' => ts('Description'),
122 'description' => 'Financial Type Description.',
124 'size' => CRM_Utils_Type
::HUGE
,
125 'table_name' => 'civicrm_financial_type',
126 'entity' => 'FinancialType',
127 'bao' => 'CRM_Financial_BAO_FinancialType',
131 'name' => 'is_deductible',
132 'type' => CRM_Utils_Type
::T_BOOLEAN
,
133 'title' => ts('Is Tax Deductible?'),
134 'description' => '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.',
136 'table_name' => 'civicrm_financial_type',
137 'entity' => 'FinancialType',
138 'bao' => 'CRM_Financial_BAO_FinancialType',
142 'name' => 'is_reserved',
143 'type' => CRM_Utils_Type
::T_BOOLEAN
,
144 'title' => ts('Financial Type is Reserved?'),
145 'description' => 'Is this a predefined system object?',
146 'table_name' => 'civicrm_financial_type',
147 'entity' => 'FinancialType',
148 'bao' => 'CRM_Financial_BAO_FinancialType',
152 'name' => 'is_active',
153 'type' => CRM_Utils_Type
::T_BOOLEAN
,
154 'title' => ts('Financial Type Is Active?'),
155 'description' => 'Is this property active?',
156 'table_name' => 'civicrm_financial_type',
157 'entity' => 'FinancialType',
158 'bao' => 'CRM_Financial_BAO_FinancialType',
162 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
164 return Civi
::$statics[__CLASS__
]['fields'];
168 * Return a mapping from field-name to the corresponding key (as used in fields()).
171 * Array(string $name => string $uniqueName).
173 public static function &fieldKeys() {
174 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
175 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
177 return Civi
::$statics[__CLASS__
]['fieldKeys'];
181 * Returns the names of this table
185 public static function getTableName() {
186 return self
::$_tableName;
190 * Returns if this table needs to be logged
194 public function getLog() {
199 * Returns the list of fields that can be imported
201 * @param bool $prefix
205 public static function &import($prefix = FALSE) {
206 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'financial_type', $prefix, []);
211 * Returns the list of fields that can be exported
213 * @param bool $prefix
217 public static function &export($prefix = FALSE) {
218 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'financial_type', $prefix, []);
223 * Returns the list of indices
225 * @param bool $localize
229 public static function indices($localize = TRUE) {
236 'localizable' => FALSE,
238 'sig' => 'civicrm_financial_type::1::id',
241 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;