Skip to content
Snippets Groups Projects
Commit de668aa8 authored by eileen's avatar eileen
Browse files

[REF] Fix Order class to not reload if already loaded

parent efbd9747
Branches
Tags
No related merge requests found
......@@ -176,13 +176,21 @@ class CRM_Financial_BAO_Order {
* @param int $id
*
* @return array
* @throws \CiviCRM_API3_Exception
*/
public function getPriceFieldSpec(int $id) :array {
if (!isset($this->priceFieldMetadata[$id])) {
return $this->getPriceFieldsMetadata()[$id];
}
/**
* Get the metadata for the fields in the price set.
*
* @return array
*/
public function getPriceFieldsMetadata(): array {
if (empty($this->priceFieldMetadata)) {
$this->priceFieldMetadata = CRM_Price_BAO_PriceSet::getCachedPriceSetDetail($this->getPriceSetID())['fields'];
}
return $this->priceFieldMetadata[$id];
return $this->priceFieldMetadata;
}
/**
......@@ -193,7 +201,7 @@ class CRM_Financial_BAO_Order {
*
* @param array $input
*/
public function setPriceSelectionFromUnfilteredInput(array $input) {
public function setPriceSelectionFromUnfilteredInput(array $input): void {
foreach ($input as $fieldName => $value) {
if (strpos($fieldName, 'price_') === 0) {
$fieldID = substr($fieldName, 6);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment