Source of file CurrencyTrait.php
Size: 1,282 Bytes - Last Modified: 2021-12-24T06:51:34+00:00
/var/www/docs.ssmods.com/process/src/src/Currency/Traits/CurrencyTrait.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 | <?php /** * This file is part of the Ecommerce-Core package * * @package Ecommerce-Core */ /** * Traits namespace */ namespace Heystack\Ecommerce\Currency\Traits; use Heystack\Core\GenerateContainerDataObjectTrait; use Heystack\Core\Identifier\Identifier; /** * Provides a basic implementation of the CurrencyInterface for dataobjects * * @copyright Heyday * @author Cam Spiers <cameron@heyday.co.nz> * @package Ecommerce-Core */ trait CurrencyTrait { /** * @return \Heystack\Core\Identifier\Identifier */ public function getIdentifier() { return new Identifier($this->getCurrencyCode()); } /** * @return mixed */ public function getCurrencyCode() { return $this->getField('CurrencyCode'); } /** * @return mixed */ public function getSymbol() { return $this->getField('Symbol'); } /** * @return mixed */ public function isDefaultCurrency() { return $this->getField('IsDefaultCurrency'); } /** * @return mixed */ public function getValue() { return $this->getField('Value'); } /** * @param string $field * @return mixed */ public abstract function getField($field); } |