for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace Arcanedev\Currencies\Entities;
use Arcanedev\Support\Collection;
/**
* Class RateCollection
*
* @package Arcanedev\Currencies\Entities
* @author ARCANEDEV <[email protected]>
*/
class RateCollection extends Collection
{
/* ------------------------------------------------------------------------------------------------
| Properties
| ------------------------------------------------------------------------------------------------
* @var string
protected $from;
| Getters & Setters
* Get the `from` currency iso.
* @return string
public function getFrom()
return $this->from;
}
* Set the `from` currency iso.
* @param string $from
* @return self
public function setFrom($from)
$this->from = $from;
return $this;
| Main Functions
* Load rates.
* @param array $rates
* @return static
public function load($from, array $rates)
$this->reset();
$this->setFrom($from);
foreach ($rates as $to => $ratio) {
$this->put($to, Rate::make($from, $to, $ratio));