/*!
\static
\params
codeList     - specifies currencies to fetch. If 'false' then all prices for '$contentAttributeID/$contentObjectVersion' will be retrieved.
965638
static function fetch( $contentAttributeID, $contentObjectVersion, $currencyCode = false, $type = false, $asObjects = true )
    {
        $priceList = null;
        $conds = array();

        $conds['contentobject_attr_id'] = $contentAttributeID;
        $conds['contentobject_attr_version'] = $contentObjectVersion;

        if ( is_array( $currencyCode ) )
            $conds['currency_code'] = array( $currencyCode );
        else if ( $currencyCode != false )
            $conds['currency_code'] = $currencyCode;

        if ( is_array( $type ) )
            $conds['type'] = array( $type );
        else if ( $type != false )
            $conds['type'] = $type;



        $sort = null;
        $limitation = null;

        $rows = eZPersistentObject::fetchObjectList( eZMultiPriceData::definition(),
                                                     null,
                                                     $conds,
                                                     $sort,
                                                     $limitation,
                                                     $asObjects );


        if ( count( $rows ) > 0 )
        {
            $keys = array_keys( $rows );
            foreach ( $keys as $key )
            {
                if ( $asObjects )
                    $priceList[$rows[$key]->attribute( 'currency_code' )] = $rows[$key];
                else
                    $priceList[$rows[$key]['currency_code']] = $rows[$key];
            }
        }

        return $priceList;
    }
1146084
def get_prices_from_csv(self, content: str) -> List[PriceModel]:
        
        from gnucash_portfolio.model.price_model import PriceModel_Csv

        lines = content.splitlines()
        prices = []

        reader = csv.reader(lines)
        for row in reader:
            csv_price = PriceModel_Csv()
            csv_price.parse(row)

            price = PriceModel()
            price.datetime = csv_price.date
            price.symbol = csv_price.symbol
            price.value = csv_price.value
            price.currency = self.currency

            prices.append(price)
        return prices
831271
public function getPriceOffsets()
    {
        $currencyOffsets = SaleOffsetCurrencyQuery::create()->filterBySaleId($this->getId())->find();

        $offsetList = [];

        /** @var SaleOffsetCurrency $currencyOffset */
        foreach ($currencyOffsets as $currencyOffset) {
            $offsetList[$currencyOffset->getCurrencyId()] = $currencyOffset->getPriceOffsetValue();
        }

        return $offsetList;
    }
1146223
function fetchObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
    {
        if ( $http->hasPostVariable( $base . "_data_float_" . $contentObjectAttribute->attribute( "id" ) ) )
        {
            $data = $http->postVariable( $base . "_data_float_" . $contentObjectAttribute->attribute( "id" ) );
            $contentObjectAttribute->setHTTPValue( $data );

            $locale = eZLocale::instance();
            $data = $locale->internalNumber( $data );

            $data = str_replace(" ", "", $data);

            $contentObjectAttribute->setAttribute( "data_float", $data );
            return true;
        }
        return false;
    }
1043886
protected function getListCurrency()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            $list = $this->currency->getList();
            $this->limitArray($list);
            return $list;
        }

        $result = $this->currency->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }
1059445
static function fetchLinkList( $contentObjectAttributeID, $contentObjectAttributeVersion, $asObject = true )
    {
        $linkList = array();

        $urlObjectLinkList = self::fetchLinkObjectList( $contentObjectAttributeID, $contentObjectAttributeVersion, $asObject );

        foreach ( $urlObjectLinkList as $urlObjectLink )
        {
            if ( $asObject )
            {
                $linkID = $urlObjectLink->attribute( 'url_id' );
                $linkList[] = eZURL::fetch( $linkID );
            }
            else
            {
                $linkID = $urlObjectLink['url_id'];
                $linkList[] = $linkID;
            }
        }
        return $linkList;
    }
940997
function validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
    {
        // Check "price inc/ex VAT" and "VAT type" fields.
        $vatTypeID = $http->postVariable( $base . '_ezprice_vat_id_' . $contentObjectAttribute->attribute( 'id' ) );
        $vatExInc = $http->postVariable( $base . '_ezprice_inc_ex_vat_' . $contentObjectAttribute->attribute( 'id' ) );
        if ( $vatExInc == 1 && $vatTypeID == -1 )
        {
            $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                 'Dynamic VAT cannot be included.' ) );
            return eZInputValidator::STATE_INVALID;
        }

        // Check price.
        if ( $http->hasPostVariable( $base . "_data_price_" . $contentObjectAttribute->attribute( "id" ) ) )
        {
            $data = $http->postVariable( $base . "_data_price_" . $contentObjectAttribute->attribute( "id" ) );

            $locale = eZLocale::instance();
            $data = $locale->internalCurrency( $data );
            $classAttribute = $contentObjectAttribute->contentClassAttribute();
            if( !$contentObjectAttribute->validateIsRequired() && ( $data == "" ) )
            {
                return eZInputValidator::STATE_ACCEPTED;
            }
            if ( preg_match( "#^[0-9]+(.){0,1}[0-9]{0,2}$#", $data ) )
                return eZInputValidator::STATE_ACCEPTED;

            $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                 'Invalid price.' ) );
            return eZInputValidator::STATE_INVALID;
        }
        else if ( $contentObjectAttribute->validateIsRequired() )
        {
            $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes', 'Input required.' ) );
            return eZInputValidator::STATE_INVALID;
        }
        else
        {
            return eZInputValidator::STATE_ACCEPTED;
        }
    }
60262
static function fetchByContentObjectID( $contentObjectID, $languageID, $status = null, $sorts = null, $offset = null, $length = null )
    {
        $cond = array();
        $cond['contentobject_id'] = $contentObjectID;
        if ( $languageID !== false )
        {
            $cond['language_id'] = $languageID;
        }
        if( !is_null( $status ) )
        {
            $cond['status'] = $status;
        }
        if ( is_null( $offset ) || is_null( $length ) )
        {
            return null;
        }
        else
        {
            $limit = array( 'offset' => $offset, 'length' => $length);
            $return = eZPersistentObject::fetchObjectList( self::definition(), null, $cond, $sorts, $limit );
            return $return;
        }
    }
891498
function updatePrices()
    {
        $productCollection = $this->attribute( 'productcollection' );
        if ( $productCollection )
        {
            $currencyCode = '';
            $items = $this->items();

            $db = eZDB::instance();
            $db->begin();
            foreach( $items as $itemArray )
            {
                $item = $itemArray['item_object'];
                $productContentObject = $item->attribute( 'contentobject' );
                $priceObj = null;
                $price = 0.0;
                $attributes = $productContentObject->contentObjectAttributes();
                foreach ( $attributes as $attribute )
                {
                    $dataType = $attribute->dataType();
                    if ( eZShopFunctions::isProductDatatype( $dataType->isA() ) )
                    {
                        $priceObj = $attribute->content();
                        $price += $priceObj->attribute( 'price' );
                        break;
                    }
                }
                if ( !is_object( $priceObj ) )
                    break;

                $currency = $priceObj->attribute( 'currency' );
                $optionsPrice = $item->calculatePriceWithOptions( $currency );

                $price += $optionsPrice;
                $item->setAttribute( "price", $price );
                if ( $priceObj->attribute( 'is_vat_included' ) )
                {
                    $item->setAttribute( "is_vat_inc", '1' );
                }
                else
                {
                    $item->setAttribute( "is_vat_inc", '0' );
                }
                $item->setAttribute( "vat_value", $priceObj->VATPercent( $productContentObject ) );
                $item->setAttribute( "discount", $priceObj->attribute( 'discount_percent' ) );
                $item->store();

                $currencyCode = $priceObj->attribute( 'currency' );
            }

            $productCollection->setAttribute( 'currency_code', $currencyCode );
            $productCollection->store();
            $db->commit();

            // update prices that are related to shipping values.
            eZShippingManager::updateShippingInfo( $productCollection->attribute( 'id' ) );
        }
    }
444781
static public function fetchList( $params, $limits = null, $sorts = null, $mainTranslation = false, $locale = false )
    {
        $customConds = self::fetchCustomCondsSQL( $params, $mainTranslation, $locale );

        if ( is_array( $params ) )
        {
            $newParams = array();
            foreach ( $params as $key => $value )
            {
                if ( $key != 'keyword' )
                    $newParams[$key] = $value;
                else
                    $newParams['eztags_keyword.keyword'] = $value;
            }

            $params = $newParams;
        }

        if ( is_array( $sorts ) )
        {
            $newSorts = array();
            foreach ( $sorts as $key => $value )
            {
                if ( $key != 'keyword' )
                    $newSorts[$key] = $value;
                else
                    $newSorts['eztags_keyword.keyword'] = $value;
            }

            $sorts = $newSorts;
        }
        else if ( $sorts == null )
        {
            $sorts = array( 'eztags_keyword.keyword' => 'asc' );
        }

        $tagsList = parent::fetchObjectList( self::definition(), array(), $params,
                                                         $sorts, $limits, true, false,
                                                         array( 'DISTINCT eztags.*',
                                                                array( 'operation' => 'eztags_keyword.keyword',
                                                                       'name'      => 'keyword' ),
                                                                array( 'operation' => 'eztags_keyword.locale',
                                                                       'name'      => 'locale' ) ),
                                                         array( 'eztags_keyword' ), $customConds );
        return $tagsList;
    }
1102823
function autoCurrencyList()
    {
        // 'auto currencies' are the currencies used for 'auto' prices.
        // 'auto currencies' = 'all currencies' - 'currencies of custom prices'

        $autoCurrecyList = $this->currencyList();
        $customPriceList = $this->customPriceList();
        foreach ( $customPriceList as $price )
        {
            if ( $price )
            {
                $currencyCode = $price->attribute( 'currency_code' );
                unset( $autoCurrecyList[$currencyCode] );
            }
        }

        return $autoCurrecyList;
    }
1117693
public function getList(array $options = array())
    {
        $options += array(
            'enabled' => false,
            'in_database' => false
        );

        $currencies = &gplcart_static(gplcart_array_hash(array('currency.list' => $options)));

        if (isset($currencies)) {
            return $currencies;
        }

        $this->hook->attach('currency.list.before', $options, $currencies, $this);

        if (isset($currencies)) {
            return $currencies;
        }

        $iso = (array) $this->getIso();
        $default = $this->getDefaultData();
        $saved = $this->config->get('currencies', array());
        $currencies = array_replace_recursive($iso, $saved);

        $this->hook->attach('currency.list.after', $options, $currencies, $this);

        foreach ($currencies as $code => &$currency) {

            $currency['code'] = $code;
            $currency += $default;
            $currency['in_database'] = isset($saved[$code]);

            if ($code === 'USD') {
                $currency['status'] = $currency['default'] = 1;
            }

            if ($options['enabled'] && empty($currency['status'])) {
                unset($currencies[$code]);
                continue;
            }

            if ($options['in_database'] && empty($currency['in_database'])) {
                unset($currencies[$code]);
            }
        }

        return $currencies;
    }
1052628
public static function getCurrencyList()
    {
        return [
            'EUR' => ['name' => 'Euro',                  'code' => 978, 'fraction' => 2],
            'USD' => ['name' => 'Dollar Américain',      'code' => 840, 'fraction' => 2],
            'CHF' => ['name' => 'Franc Suisse',          'code' => 756, 'fraction' => 2],
            'GBP' => ['name' => 'Livre Sterling',        'code' => 826, 'fraction' => 2],
            'CAD' => ['name' => 'Dollar Canadien',       'code' => 124, 'fraction' => 2],
            'JPY' => ['name' => 'Yen',                   'code' => 392, 'fraction' => 0],
            'MXN' => ['name' => 'Peso Mexicain',         'code' => 484, 'fraction' => 2],
            'TRY' => ['name' => 'Nouvelle Livre Turque', 'code' => 949, 'fraction' => 2],
            'AUD' => ['name' => 'Dollar Australien',     'code' => 036, 'fraction' => 2],
            'NZD' => ['name' => 'Dollar Néo-Zélandais',  'code' => 554, 'fraction' => 2],
            'NOK' => ['name' => 'Couronne Norvégienne',  'code' => 578, 'fraction' => 2],
            'BRL' => ['name' => 'Real Brésilien',        'code' => 986, 'fraction' => 2],
            'ARS' => ['name' => 'Peso Argentin',         'code' => 032, 'fraction' => 2],
            'KHR' => ['name' => 'Riel',                  'code' => 116, 'fraction' => 2],
            'TWD' => ['name' => 'Dollar de Taiwan',      'code' => 901, 'fraction' => 2],
            'SEK' => ['name' => 'Couronne Suédoise',     'code' => 752, 'fraction' => 2],
            'DKK' => ['name' => 'Couronne Danoise',      'code' => 208, 'fraction' => 2],
            'KRW' => ['name' => 'Won',                   'code' => 410, 'fraction' => 0],
            'SGD' => ['name' => 'Dollar de Singapour',   'code' => 702, 'fraction' => 2],
            'XPF' => ['name' => 'Franc Polynésien',      'code' => 953, 'fraction' => 0],
            'XOF' => ['name' => 'Franc CFA',             'code' => 952, 'fraction' => 0],
        ];
    }
1057611
function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )
    {
        if ( $currentVersion != false )
        {
//             $contentObjectAttributeID = $contentObjectAttribute->attribute( "id" );
//             $currentObjectAttribute = eZContentObjectAttribute::fetch( $contentObjectAttributeID,
//                                                                         $currentVersion );
            $dataText = $originalContentObjectAttribute->attribute( "data_text" );
            $contentObjectAttribute->setAttribute( "data_text", $dataText );
        }
        else
        {
            $contentClassAttribute = $contentObjectAttribute->contentClassAttribute();
            $default = $contentClassAttribute->attribute( 'data_text1' );
            if ( $default !== '' && $default !== NULL )
            {
                $contentObjectAttribute->setAttribute( 'data_text', $default );
            }
        }
    }
513353
function getCurrencySymbol(code, format, locale) {
    if (locale === void 0) { locale = 'en'; }
    var currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || [];
    var symbolNarrow = currency[1 /* SymbolNarrow */];
    if (format === 'narrow' && typeof symbolNarrow === 'string') {
        return symbolNarrow;
    }
    return currency[0 /* Symbol */] || code;
}
941335
function fetchAttributeTranslations( $asObject = true )
    {
        return eZPersistentObject::fetchObjectList( eZContentObjectAttribute::definition(),
                                                    null,
                                                    array( "contentclassattribute_id" => $this->ContentClassAttributeID,
                                                           "contentobject_id" => $this->ContentObjectID,
                                                           "version" => $this->Version ),
                                                    null,
                                                    null,
                                                    $asObject);
    }
981845
function getPricing(xmlNode) {
  var pricingExtNode;
  var princingData = {};

  var extensions = xmlNode.querySelectorAll('Extension');
  // Nodelist.forEach is not supported in IE and Edge
  // Workaround given here https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10638731/
  Array.prototype.forEach.call(extensions, function(node) {
    if (node.getAttribute('type') === 'StickyPricing') {
      pricingExtNode = node;
    }
  });

  if (pricingExtNode) {
    var priceNode = pricingExtNode.querySelector('Price');
    princingData = {
      currency: priceNode.getAttribute('currency'),
      price: priceNode.textContent || priceNode.innerText
    };
  } else {
    utils.logWarn('PREBID - ' + BIDDER_CODE + ': Can\'t get pricing data. Is price awareness enabled?');
  }

  return princingData;
}