acceptable as $key => $row){ $this->amount[$row] = 0; } } public function setAmount($amount, $type){ if(in_array($type, $this->acceptable)){ $this->amount[$type] += (double)$amount; } } } abstract class Currency { public static function convert() { echo "Něco s tím prověď něbo se zblázním :)"; } } class Price extends Currency { protected $priceEntity; protected function createPriceEntity(){ if(!$this->priceEntity){ $this->priceEntity = new PriceEntity(); } } public function add($amount, $type = "CZK"){ $this->createPriceEntity(); $this->priceEntity->setAmount($amount,$type); } } $currency = new Price(); $currency->add(3000,"USD"); $currency->add(2000,"CZK"); $prices = $currency->convert();