return $optionGroupIDs;
}
+ public static function buildOptions($fieldName, $context = NULL, $values = []) {
+ // Special logic for fields whose options depend on context or properties
+ if ($fieldName === 'price_set_id' && !empty($values['entity_table']) && !empty($values['entity_id'])) {
+ $priceSetIds = self::getOptionGroup($values['entity_id'], $values['entity_table']);
+ $params = ['condition' => ['id IN (' . implode(',', $priceSetIds) . ')']];
+ return CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context);
+ }
+ return parent::buildOptions($fieldName, $context, $values);
+ }
+
/**
* Determine in which discount set the registration date falls.
*
*
* Generated from xml/schema/CRM/Core/Discount.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:63b35b634e2bbd8e56e55e87c7d06f91)
+ * (GenCodeChecksum:8d80d6c79c0ecd92e22ed5ac74d59700)
*/
/**
'html' => [
'type' => 'Select',
'label' => ts("Price Set"),
+ 'controlField' => 'entity_id',
],
'pseudoconstant' => [
'table' => 'civicrm_price_set',