2018-08-11 11:33:32 +00:00
|
|
|
<?php
|
2019-08-19 21:48:04 +00:00
|
|
|
|
2018-08-11 11:33:32 +00:00
|
|
|
/**
|
|
|
|
* @package CRM
|
2019-08-19 21:48:04 +00:00
|
|
|
* @copyright CiviCRM LLC (c) 2004-2019
|
2018-08-11 11:33:32 +00:00
|
|
|
*
|
2019-08-19 21:48:04 +00:00
|
|
|
* Generated from /home/jon/local/agbud8/htdocs/web/sites/all/civicrm/extensions/org.agbu.annualgrantbudgets/xml/schema/CRM/AnnualGrantBudgets/GrantBudget.xml
|
2018-08-11 11:33:32 +00:00
|
|
|
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
2019-08-19 21:59:58 +00:00
|
|
|
* (GenCodeChecksum:36ad4daebed0e606747c4c8c53269a42)
|
2018-08-11 11:33:32 +00:00
|
|
|
*/
|
2019-08-19 21:48:04 +00:00
|
|
|
|
2018-08-11 11:33:32 +00:00
|
|
|
/**
|
2019-08-19 21:48:04 +00:00
|
|
|
* Database access object for the GrantBudget entity.
|
2018-08-11 11:33:32 +00:00
|
|
|
*/
|
2019-08-19 21:48:04 +00:00
|
|
|
class CRM_AnnualGrantBudgets_DAO_GrantBudget extends CRM_Core_DAO {
|
|
|
|
|
2018-08-11 11:33:32 +00:00
|
|
|
/**
|
|
|
|
* Static instance to hold the table name.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2019-08-19 21:48:04 +00:00
|
|
|
public static $_tableName = 'civicrm_grant_budget';
|
|
|
|
|
2018-08-11 11:33:32 +00:00
|
|
|
/**
|
|
|
|
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
|
|
|
*
|
2019-08-19 21:48:04 +00:00
|
|
|
* @var bool
|
2018-08-11 11:33:32 +00:00
|
|
|
*/
|
2019-08-19 21:48:04 +00:00
|
|
|
public static $_log = TRUE;
|
|
|
|
|
2018-08-11 11:33:32 +00:00
|
|
|
/**
|
2019-08-19 21:48:04 +00:00
|
|
|
* Unique GrantBudget ID
|
2018-08-11 11:33:32 +00:00
|
|
|
*
|
2019-08-19 21:48:04 +00:00
|
|
|
* @var int
|
2018-08-11 11:33:32 +00:00
|
|
|
*/
|
|
|
|
public $id;
|
2019-08-19 21:48:04 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* FK to Financial Type
|
|
|
|
*
|
|
|
|
* @var int
|
|
|
|
*/
|
2018-08-11 11:33:32 +00:00
|
|
|
public $financial_type_id;
|
2019-08-19 21:48:04 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Fiscal year
|
|
|
|
*
|
|
|
|
* @var int
|
|
|
|
*/
|
2018-08-11 11:33:32 +00:00
|
|
|
public $fiscal_year;
|
2019-08-19 21:48:04 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Grant Annual Budget
|
|
|
|
*
|
|
|
|
* @var float
|
|
|
|
*/
|
2018-08-11 11:33:32 +00:00
|
|
|
public $budget;
|
|
|
|
|
2019-08-19 21:59:58 +00:00
|
|
|
/**
|
|
|
|
* Note
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public $note;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Is this budget item locked for non-administrators?
|
|
|
|
*
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $is_reserved;
|
|
|
|
|
2019-08-19 21:48:04 +00:00
|
|
|
/**
|
|
|
|
* Class constructor.
|
|
|
|
*/
|
2018-08-11 23:43:25 +00:00
|
|
|
public function __construct() {
|
2018-08-11 11:33:32 +00:00
|
|
|
$this->__table = 'civicrm_grant_budget';
|
|
|
|
parent::__construct();
|
|
|
|
}
|
2019-08-19 21:48:04 +00:00
|
|
|
|
2018-08-11 11:33:32 +00:00
|
|
|
/**
|
|
|
|
* Returns foreign keys and entity references.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
* [CRM_Core_Reference_Interface]
|
|
|
|
*/
|
2018-08-11 23:43:25 +00:00
|
|
|
public static function getReferenceColumns() {
|
2018-08-11 11:33:32 +00:00
|
|
|
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
2019-08-19 21:48:04 +00:00
|
|
|
Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
|
|
|
|
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'financial_type_id', 'civicrm_financial_type', 'id');
|
2018-08-11 11:33:32 +00:00
|
|
|
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
|
|
|
}
|
|
|
|
return Civi::$statics[__CLASS__]['links'];
|
|
|
|
}
|
2019-08-19 21:48:04 +00:00
|
|
|
|
2018-08-11 11:33:32 +00:00
|
|
|
/**
|
|
|
|
* Returns all the column names of this table
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2018-08-11 23:43:25 +00:00
|
|
|
public static function &fields() {
|
2018-08-11 11:33:32 +00:00
|
|
|
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
|
|
|
Civi::$statics[__CLASS__]['fields'] = [
|
|
|
|
'id' => [
|
|
|
|
'name' => 'id',
|
|
|
|
'type' => CRM_Utils_Type::T_INT,
|
2019-08-19 21:48:04 +00:00
|
|
|
'description' => CRM_AnnualGrantBudgets_ExtensionUtil::ts('Unique GrantBudget ID'),
|
2018-08-11 23:43:25 +00:00
|
|
|
'required' => TRUE,
|
2019-08-19 21:48:04 +00:00
|
|
|
'where' => 'civicrm_grant_budget.id',
|
2018-08-11 11:33:32 +00:00
|
|
|
'table_name' => 'civicrm_grant_budget',
|
|
|
|
'entity' => 'GrantBudget',
|
2019-08-19 21:48:04 +00:00
|
|
|
'bao' => 'CRM_AnnualGrantBudgets_DAO_GrantBudget',
|
|
|
|
'localizable' => 1,
|
2018-08-11 11:33:32 +00:00
|
|
|
],
|
|
|
|
'financial_type_id' => [
|
|
|
|
'name' => 'financial_type_id',
|
|
|
|
'type' => CRM_Utils_Type::T_INT,
|
2019-08-19 21:48:04 +00:00
|
|
|
'title' => CRM_AnnualGrantBudgets_ExtensionUtil::ts('Financial Type Id'),
|
|
|
|
'description' => CRM_AnnualGrantBudgets_ExtensionUtil::ts('FK to Financial Type'),
|
2018-08-11 11:33:32 +00:00
|
|
|
'required' => TRUE,
|
|
|
|
'import' => TRUE,
|
2019-08-19 21:48:04 +00:00
|
|
|
'where' => 'civicrm_grant_budget.financial_type_id',
|
2018-08-11 11:33:32 +00:00
|
|
|
'export' => FALSE,
|
|
|
|
'table_name' => 'civicrm_grant_budget',
|
|
|
|
'entity' => 'GrantBudget',
|
2019-08-19 21:48:04 +00:00
|
|
|
'bao' => 'CRM_AnnualGrantBudgets_DAO_GrantBudget',
|
|
|
|
'localizable' => 1,
|
2018-08-11 11:33:32 +00:00
|
|
|
'html' => [
|
|
|
|
'type' => 'Select',
|
|
|
|
],
|
|
|
|
'pseudoconstant' => [
|
|
|
|
'table' => 'civicrm_financial_type',
|
|
|
|
'keyColumn' => 'id',
|
|
|
|
'labelColumn' => 'name',
|
2019-08-19 21:48:04 +00:00
|
|
|
],
|
2018-08-11 11:33:32 +00:00
|
|
|
],
|
|
|
|
'fiscal_year' => [
|
|
|
|
'name' => 'fiscal_year',
|
|
|
|
'type' => CRM_Utils_Type::T_INT,
|
2019-08-19 21:48:04 +00:00
|
|
|
'title' => CRM_AnnualGrantBudgets_ExtensionUtil::ts('Fiscal Year'),
|
|
|
|
'description' => CRM_AnnualGrantBudgets_ExtensionUtil::ts('Fiscal year'),
|
2018-08-11 11:33:32 +00:00
|
|
|
'required' => TRUE,
|
|
|
|
'import' => TRUE,
|
2019-08-19 21:48:04 +00:00
|
|
|
'where' => 'civicrm_grant_budget.fiscal_year',
|
2018-08-11 11:33:32 +00:00
|
|
|
'export' => FALSE,
|
|
|
|
'table_name' => 'civicrm_grant_budget',
|
|
|
|
'entity' => 'GrantBudget',
|
2019-08-19 21:48:04 +00:00
|
|
|
'bao' => 'CRM_AnnualGrantBudgets_DAO_GrantBudget',
|
|
|
|
'localizable' => 1,
|
2018-08-11 11:33:32 +00:00
|
|
|
'html' => [
|
|
|
|
'type' => 'Select',
|
|
|
|
],
|
|
|
|
'pseudoconstant' => [
|
|
|
|
'callback' => 'CRM_Grant_BAO_GrantBudget::getFiscalyear',
|
2019-08-19 21:48:04 +00:00
|
|
|
],
|
2018-08-11 11:33:32 +00:00
|
|
|
],
|
|
|
|
'budget' => [
|
|
|
|
'name' => 'budget',
|
|
|
|
'type' => CRM_Utils_Type::T_MONEY,
|
2019-08-19 21:48:04 +00:00
|
|
|
'title' => CRM_AnnualGrantBudgets_ExtensionUtil::ts('Grant Annual Budget'),
|
|
|
|
'description' => CRM_AnnualGrantBudgets_ExtensionUtil::ts('Grant Annual Budget'),
|
2018-08-11 11:33:32 +00:00
|
|
|
'required' => TRUE,
|
|
|
|
'precision' => [
|
|
|
|
20,
|
2019-08-19 21:48:04 +00:00
|
|
|
2,
|
2018-08-11 11:33:32 +00:00
|
|
|
],
|
|
|
|
'import' => TRUE,
|
2019-08-19 21:48:04 +00:00
|
|
|
'where' => 'civicrm_grant_budget.budget',
|
2018-08-11 11:33:32 +00:00
|
|
|
'export' => TRUE,
|
2019-08-19 21:48:04 +00:00
|
|
|
'default' => '0.00',
|
2018-08-11 11:33:32 +00:00
|
|
|
'table_name' => 'civicrm_grant_budget',
|
|
|
|
'entity' => 'GrantBudget',
|
2019-08-19 21:48:04 +00:00
|
|
|
'bao' => 'CRM_AnnualGrantBudgets_DAO_GrantBudget',
|
|
|
|
'localizable' => 1,
|
2018-08-11 11:33:32 +00:00
|
|
|
'html' => [
|
|
|
|
'type' => 'Text',
|
|
|
|
],
|
|
|
|
],
|
2019-08-19 21:59:58 +00:00
|
|
|
'note' => [
|
|
|
|
'name' => 'note',
|
|
|
|
'type' => CRM_Utils_Type::T_STRING,
|
|
|
|
'title' => CRM_AnnualGrantBudgets_ExtensionUtil::ts('Note'),
|
|
|
|
'description' => CRM_AnnualGrantBudgets_ExtensionUtil::ts('Note'),
|
|
|
|
'required' => FALSE,
|
|
|
|
'maxlength' => 255,
|
|
|
|
'size' => CRM_Utils_Type::HUGE,
|
|
|
|
'import' => TRUE,
|
|
|
|
'where' => 'civicrm_grant_budget.note',
|
|
|
|
'export' => TRUE,
|
|
|
|
'table_name' => 'civicrm_grant_budget',
|
|
|
|
'entity' => 'GrantBudget',
|
|
|
|
'bao' => 'CRM_AnnualGrantBudgets_DAO_GrantBudget',
|
|
|
|
'localizable' => 1,
|
|
|
|
'html' => [
|
|
|
|
'type' => 'Text',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'is_reserved' => [
|
|
|
|
'name' => 'is_reserved',
|
|
|
|
'type' => CRM_Utils_Type::T_BOOLEAN,
|
|
|
|
'title' => CRM_AnnualGrantBudgets_ExtensionUtil::ts('Is Reserved'),
|
|
|
|
'description' => CRM_AnnualGrantBudgets_ExtensionUtil::ts('Is this budget item locked for non-administrators?'),
|
|
|
|
'import' => TRUE,
|
|
|
|
'where' => 'civicrm_grant_budget.is_reserved',
|
|
|
|
'export' => TRUE,
|
|
|
|
'default' => '0',
|
|
|
|
'table_name' => 'civicrm_grant_budget',
|
|
|
|
'entity' => 'GrantBudget',
|
|
|
|
'bao' => 'CRM_AnnualGrantBudgets_DAO_GrantBudget',
|
|
|
|
'localizable' => 1,
|
|
|
|
'html' => [
|
|
|
|
'type' => 'CheckBox',
|
|
|
|
],
|
|
|
|
],
|
2018-08-11 11:33:32 +00:00
|
|
|
];
|
|
|
|
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
|
|
|
}
|
|
|
|
return Civi::$statics[__CLASS__]['fields'];
|
|
|
|
}
|
2019-08-19 21:48:04 +00:00
|
|
|
|
2018-08-11 11:33:32 +00:00
|
|
|
/**
|
|
|
|
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
* Array(string $name => string $uniqueName).
|
|
|
|
*/
|
2018-08-11 23:43:25 +00:00
|
|
|
public static function &fieldKeys() {
|
2018-08-11 11:33:32 +00:00
|
|
|
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
|
|
|
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
|
|
|
}
|
|
|
|
return Civi::$statics[__CLASS__]['fieldKeys'];
|
|
|
|
}
|
2019-08-19 21:48:04 +00:00
|
|
|
|
2018-08-11 11:33:32 +00:00
|
|
|
/**
|
|
|
|
* Returns the names of this table
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2018-08-11 23:43:25 +00:00
|
|
|
public static function getTableName() {
|
2019-08-19 21:48:04 +00:00
|
|
|
return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
|
2018-08-11 11:33:32 +00:00
|
|
|
}
|
2019-08-19 21:48:04 +00:00
|
|
|
|
2018-08-11 11:33:32 +00:00
|
|
|
/**
|
|
|
|
* Returns if this table needs to be logged
|
|
|
|
*
|
2018-08-11 23:43:25 +00:00
|
|
|
* @return bool
|
2018-08-11 11:33:32 +00:00
|
|
|
*/
|
2018-08-11 23:43:25 +00:00
|
|
|
public function getLog() {
|
2018-08-11 11:33:32 +00:00
|
|
|
return self::$_log;
|
|
|
|
}
|
2019-08-19 21:48:04 +00:00
|
|
|
|
2018-08-11 11:33:32 +00:00
|
|
|
/**
|
|
|
|
* Returns the list of fields that can be imported
|
|
|
|
*
|
|
|
|
* @param bool $prefix
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2018-08-11 23:43:25 +00:00
|
|
|
public static function &import($prefix = FALSE) {
|
2018-08-11 11:33:32 +00:00
|
|
|
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'grant_budget', $prefix, []);
|
|
|
|
return $r;
|
|
|
|
}
|
2019-08-19 21:48:04 +00:00
|
|
|
|
2018-08-11 11:33:32 +00:00
|
|
|
/**
|
|
|
|
* Returns the list of fields that can be exported
|
|
|
|
*
|
|
|
|
* @param bool $prefix
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2018-08-11 23:43:25 +00:00
|
|
|
public static function &export($prefix = FALSE) {
|
2018-08-11 11:33:32 +00:00
|
|
|
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'grant_budget', $prefix, []);
|
|
|
|
return $r;
|
|
|
|
}
|
2019-08-19 21:48:04 +00:00
|
|
|
|
2018-08-11 11:33:32 +00:00
|
|
|
/**
|
|
|
|
* Returns the list of indices
|
2019-08-19 21:48:04 +00:00
|
|
|
*
|
|
|
|
* @param bool $localize
|
|
|
|
*
|
|
|
|
* @return array
|
2018-08-11 11:33:32 +00:00
|
|
|
*/
|
|
|
|
public static function indices($localize = TRUE) {
|
|
|
|
$indices = [];
|
|
|
|
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
|
|
|
}
|
2018-08-11 23:43:25 +00:00
|
|
|
|
2018-08-11 11:33:32 +00:00
|
|
|
}
|