Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Currency Class Reference
Inheritance diagram for Currency:
AbstractExtensibleModel CurrencyInterface AbstractModel CustomAttributesDataInterface ExtensibleDataInterface DataObject ExtensibleDataInterface

Public Member Functions

 getGlobalCurrencyCode ()
 
 getBaseCurrencyCode ()
 
 getStoreCurrencyCode ()
 
 getQuoteCurrencyCode ()
 
 getStoreToBaseRate ()
 
 getStoreToQuoteRate ()
 
 getBaseToGlobalRate ()
 
 getBaseToQuoteRate ()
 
 setGlobalCurrencyCode ($globalCurrencyCode)
 
 setBaseCurrencyCode ($baseCurrencyCode)
 
 setStoreCurrencyCode ($storeCurrencyCode)
 
 setQuoteCurrencyCode ($quoteCurrencyCode)
 
 setStoreToBaseRate ($storeToBaseRate)
 
 setStoreToQuoteRate ($storeToQuoteRate)
 
 setBaseToGlobalRate ($baseToGlobalRate)
 
 setBaseToQuoteRate ($baseToQuoteRate)
 
 getExtensionAttributes ()
 
 setExtensionAttributes (\Magento\Quote\Api\Data\CurrencyExtensionInterface $extensionAttributes)
 
- Public Member Functions inherited from AbstractExtensibleModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, ExtensionAttributesFactory $extensionFactory, AttributeValueFactory $customAttributeFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 getCustomAttributes ()
 
 getCustomAttribute ($attributeCode)
 
 setCustomAttributes (array $attributes)
 
 setCustomAttribute ($attributeCode, $attributeValue)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 setId ($value)
 
 __sleep ()
 
 __wakeup ()
 
- Public Member Functions inherited from AbstractModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 __sleep ()
 
 __wakeup ()
 
 setIdFieldName ($name)
 
 getIdFieldName ()
 
 getId ()
 
 setId ($value)
 
 isDeleted ($isDeleted=null)
 
 hasDataChanges ()
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 setDataChanges ($value)
 
 getOrigData ($key=null)
 
 setOrigData ($key=null, $data=null)
 
 dataHasChangedFor ($field)
 
 getResourceName ()
 
 getResourceCollection ()
 
 getCollection ()
 
 load ($modelId, $field=null)
 
 beforeLoad ($identifier, $field=null)
 
 afterLoad ()
 
 isSaveAllowed ()
 
 setHasDataChanges ($flag)
 
 save ()
 
 afterCommitCallback ()
 
 isObjectNew ($flag=null)
 
 beforeSave ()
 
 validateBeforeSave ()
 
 getCacheTags ()
 
 cleanModelCache ()
 
 afterSave ()
 
 delete ()
 
 beforeDelete ()
 
 afterDelete ()
 
 afterDeleteCommit ()
 
 getResource ()
 
 getEntityId ()
 
 setEntityId ($entityId)
 
 clearInstance ()
 
 getStoredData ()
 
 getEventPrefix ()
 
- Public Member Functions inherited from DataObject
 __construct (array $data=[])
 
 addData (array $arr)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 getDataByPath ($path)
 
 getDataByKey ($key)
 
 setDataUsingMethod ($key, $args=[])
 
 getDataUsingMethod ($key, $args=null)
 
 hasData ($key='')
 
 toArray (array $keys=[])
 
 convertToArray (array $keys=[])
 
 toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 toJson (array $keys=[])
 
 convertToJson (array $keys=[])
 
 toString ($format='')
 
 __call ($method, $args)
 
 isEmpty ()
 
 serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
 
 debug ($data=null, &$objects=[])
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 offsetGet ($offset)
 
- Public Member Functions inherited from CurrencyInterface
 setExtensionAttributes (\Magento\Quote\Api\Data\CurrencyExtensionInterface $extensionAttributes)
 

Additional Inherited Members

- Data Fields inherited from CustomAttributesDataInterface
const CUSTOM_ATTRIBUTES = 'custom_attributes'
 
- Data Fields inherited from ExtensibleDataInterface
const EXTENSION_ATTRIBUTES_KEY = 'extension_attributes'
 
- Data Fields inherited from CurrencyInterface
const KEY_GLOBAL_CURRENCY_CODE = 'global_currency_code'
 
const KEY_BASE_CURRENCY_CODE = 'base_currency_code'
 
const KEY_STORE_CURRENCY_CODE = 'store_currency_code'
 
const KEY_QUOTE_CURRENCY_CODE = 'quote_currency_code'
 
const KEY_STORE_TO_BASE_RATE = 'store_to_base_rate'
 
const KEY_STORE_TO_QUOTE_RATE = 'store_to_quote_rate'
 
const KEY_BASE_TO_GLOBAL_RATE = 'base_to_global_rate'
 
const KEY_BASE_TO_QUOTE_RATE = 'base_to_quote_rate'
 
- Protected Member Functions inherited from AbstractExtensibleModel
 filterCustomAttributes ($data)
 
 initializeCustomAttributes ()
 
 convertCustomAttributeValues (array &$customAttributes)
 
 getCustomAttributesCodes ()
 
 _setExtensionAttributes (\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
 
 _getExtensionAttributes ()
 
- Protected Member Functions inherited from AbstractModel
 _construct ()
 
 _init ($resourceModel)
 
 _setResourceModel ($resourceName, $collectionName=null)
 
 _getResource ()
 
 _getEventData ()
 
 _beforeLoad ($modelId, $field=null)
 
 _afterLoad ()
 
 _hasModelChanged ()
 
 _getValidatorBeforeSave ()
 
 _createValidatorBeforeSave ()
 
 _getValidationRulesBeforeSave ()
 
 _clearReferences ()
 
 _clearData ()
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 
- Protected Attributes inherited from AbstractExtensibleModel
 $extensionAttributesFactory
 
 $extensionAttributes
 
 $customAttributeFactory
 
 $customAttributesCodes = null
 
 $customAttributesChanged = false
 
- Protected Attributes inherited from AbstractModel
 $_eventPrefix = 'core_abstract'
 
 $_eventObject = 'object'
 
 $_idFieldName = 'id'
 
 $_hasDataChanges = false
 
 $_origData
 
 $_isDeleted = false
 
 $_resource
 
 $_resourceCollection
 
 $_resourceName
 
 $_collectionName
 
 $_cacheTag = false
 
 $_dataSaveAllowed = true
 
 $_isObjectNew = null
 
 $_validatorBeforeSave = null
 
 $_eventManager
 
 $_cacheManager
 
 $_registry
 
 $_logger
 
 $_appState
 
 $_actionValidator
 
 $storedData = []
 
- Protected Attributes inherited from DataObject
 $_data = []
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

@codeCoverageIgnore

Definition at line 11 of file Currency.php.

Member Function Documentation

◆ getBaseCurrencyCode()

getBaseCurrencyCode ( )

{Get base currency code

Returns
string|null
}

Implements CurrencyInterface.

Definition at line 25 of file Currency.php.

26  {
27  return $this->getData(self::KEY_BASE_CURRENCY_CODE);
28  }

◆ getBaseToGlobalRate()

getBaseToGlobalRate ( )

{Get base currency to global currency rate

Returns
float|null
}

Implements CurrencyInterface.

Definition at line 65 of file Currency.php.

66  {
67  return $this->getData(self::KEY_BASE_TO_GLOBAL_RATE);
68  }

◆ getBaseToQuoteRate()

getBaseToQuoteRate ( )

{Get base currency to quote currency rate

Returns
float|null
}

Implements CurrencyInterface.

Definition at line 73 of file Currency.php.

74  {
75  return $this->getData(self::KEY_BASE_TO_QUOTE_RATE);
76  }

◆ getExtensionAttributes()

getExtensionAttributes ( )

{Retrieve existing extension attributes object or create a new one.

Returns
\Magento\Quote\Api\Data\CurrencyExtensionInterface|null
}

Returns
\Magento\Quote\Api\Data\CurrencyExtensionInterface|null

Implements CurrencyInterface.

Definition at line 171 of file Currency.php.

◆ getGlobalCurrencyCode()

getGlobalCurrencyCode ( )

{#- Get global currency code

Returns
string|null
}

Implements CurrencyInterface.

Definition at line 17 of file Currency.php.

18  {
19  return $this->getData(self::KEY_GLOBAL_CURRENCY_CODE);
20  }

◆ getQuoteCurrencyCode()

getQuoteCurrencyCode ( )

{Get quote currency code

Returns
string|null
}

Implements CurrencyInterface.

Definition at line 41 of file Currency.php.

42  {
43  return $this->getData(self::KEY_QUOTE_CURRENCY_CODE);
44  }

◆ getStoreCurrencyCode()

getStoreCurrencyCode ( )

{Get store currency code

Returns
string|null
}

Implements CurrencyInterface.

Definition at line 33 of file Currency.php.

34  {
35  return $this->getData(self::KEY_STORE_CURRENCY_CODE);
36  }

◆ getStoreToBaseRate()

getStoreToBaseRate ( )

{Get store currency to base currency rate

Returns
float|null
}

Implements CurrencyInterface.

Definition at line 49 of file Currency.php.

50  {
51  return $this->getData(self::KEY_STORE_TO_BASE_RATE);
52  }

◆ getStoreToQuoteRate()

getStoreToQuoteRate ( )

{Get store currency to quote currency rate

Returns
float|null
}

Implements CurrencyInterface.

Definition at line 57 of file Currency.php.

58  {
59  return $this->getData(self::KEY_STORE_TO_QUOTE_RATE);
60  }

◆ setBaseCurrencyCode()

setBaseCurrencyCode (   $baseCurrencyCode)

Set base currency code

Parameters
string$baseCurrencyCode
Returns
$this

Implements CurrencyInterface.

Definition at line 95 of file Currency.php.

96  {
97  return $this->setData(self::KEY_BASE_CURRENCY_CODE, $baseCurrencyCode);
98  }

◆ setBaseToGlobalRate()

setBaseToGlobalRate (   $baseToGlobalRate)

Set base currency to global currency rate

Parameters
float$baseToGlobalRate
Returns
$this

Implements CurrencyInterface.

Definition at line 150 of file Currency.php.

151  {
152  return $this->setData(self::KEY_BASE_TO_GLOBAL_RATE, $baseToGlobalRate);
153  }

◆ setBaseToQuoteRate()

setBaseToQuoteRate (   $baseToQuoteRate)

Set base currency to quote currency rate

Parameters
float$baseToQuoteRate
Returns
$this

Implements CurrencyInterface.

Definition at line 161 of file Currency.php.

162  {
163  return $this->setData(self::KEY_BASE_TO_QUOTE_RATE, $baseToQuoteRate);
164  }

◆ setExtensionAttributes()

setExtensionAttributes ( \Magento\Quote\Api\Data\CurrencyExtensionInterface  $extensionAttributes)

{}

Parameters
\Magento\Quote\Api\Data\CurrencyExtensionInterface$extensionAttributes
Returns
$this

Definition at line 182 of file Currency.php.

183  {
185  }
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)

◆ setGlobalCurrencyCode()

setGlobalCurrencyCode (   $globalCurrencyCode)

Set global currency code

Parameters
string$globalCurrencyCode
Returns
$this

Implements CurrencyInterface.

Definition at line 84 of file Currency.php.

85  {
86  return $this->setData(self::KEY_GLOBAL_CURRENCY_CODE, $globalCurrencyCode);
87  }

◆ setQuoteCurrencyCode()

setQuoteCurrencyCode (   $quoteCurrencyCode)

Set quote currency code

Parameters
string$quoteCurrencyCode
Returns
$this

Implements CurrencyInterface.

Definition at line 117 of file Currency.php.

118  {
119  return $this->setData(self::KEY_QUOTE_CURRENCY_CODE, $quoteCurrencyCode);
120  }

◆ setStoreCurrencyCode()

setStoreCurrencyCode (   $storeCurrencyCode)

Set store currency code

Parameters
string$storeCurrencyCode
Returns
$this

Implements CurrencyInterface.

Definition at line 106 of file Currency.php.

107  {
108  return $this->setData(self::KEY_STORE_CURRENCY_CODE, $storeCurrencyCode);
109  }

◆ setStoreToBaseRate()

setStoreToBaseRate (   $storeToBaseRate)

Set store currency to base currency rate

Parameters
float$storeToBaseRate
Returns
$this

Implements CurrencyInterface.

Definition at line 128 of file Currency.php.

129  {
130  return $this->setData(self::KEY_STORE_TO_BASE_RATE, $storeToBaseRate);
131  }

◆ setStoreToQuoteRate()

setStoreToQuoteRate (   $storeToQuoteRate)

Set store currency to quote currency rate

Parameters
float$storeToQuoteRate
Returns
$this

Implements CurrencyInterface.

Definition at line 139 of file Currency.php.

140  {
141  return $this->setData(self::KEY_STORE_TO_QUOTE_RATE, $storeToQuoteRate);
142  }

The documentation for this class was generated from the following file: