*/
class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
- /**
- * Class constructor.
- */
- public function __construct() {
- parent::__construct();
- }
-
/**
* Fetch object based on array of properties.
*
* @param array $defaults
* (reference ) an assoc array to hold the flattened values.
*
- * @return CRM_Event_DAO_Event
+ * @return CRM_Event_DAO_Event|null
*/
public static function retrieve(&$params, &$defaults) {
$event = new CRM_Event_DAO_Event();
}
/**
- * Get the information to map a event.
+ * Get the information to map an event.
*
* @param int $id
* For which we want map info.
*
- * @return null|string
- * title of the event
+ * @return array
*/
public static function &getMapInfo(&$id) {
* @param int $id
* @param string $name
* @param int $cid
- * @param string $template
+ * @param \CRM_Core_Smarty $template
* @param int $participantId
* @param bool $isTest
* @param bool $returnResults
}
}
elseif ($dao->data_type == 'Float') {
- $customVal = (float ) ($params[$name]);
+ $customVal = (float) ($params[$name]);
}
elseif ($dao->data_type == 'Date') {
//@todo note the currently we are using default date time formatting. Since you can select/set
*
* @param int $eventId
* Event id.
- * @param sting $extraWhereClause
+ * @param string $extraWhereClause
* Extra filter on participants.
*
* @return int
// Special logic for fields whose options depend on context or properties
switch ($fieldName) {
case 'financial_type_id':
- // @fixme - this is going to ignore context, better to get conditions, add params, and call PseudoConstant::get
- // @fixme - https://lab.civicrm.org/dev/core/issues/547 if CiviContribute not enabled this causes an invalid query
- // because $relationTypeId is not set in CRM_Financial_BAO_FinancialType::getIncomeFinancialType()
- if (array_key_exists('CiviContribute', CRM_Core_Component::getEnabledComponents())) {
- return CRM_Financial_BAO_FinancialType::getIncomeFinancialType();
+ // https://lab.civicrm.org/dev/core/issues/547 if CiviContribute not enabled this causes an invalid query
+ // @todo - the component is enabled check should be done within getIncomeFinancialType
+ // It looks to me like test cover was NOT added to cover the change
+ // that added this so we need to assume there is no test cover
+ if (CRM_Core_Component::isEnabled('CiviContribute')) {
+ return CRM_Financial_BAO_FinancialType::getIncomeFinancialType($props['check_permissions'] ?? TRUE);
}
return [];
}