HosipLan

Untitled

Jul 23rd, 2011
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. class dph
  2. {
  3.  
  4.     private $dph;
  5.  
  6.     public function __construct($dph)
  7.     {
  8.         $this->dph = $dph;
  9.     }
  10.  
  11.  
  12.     public function calculatePrice($price)
  13.     {
  14.         // doufám že ten vzoreček mám správně :))
  15.         return $price + ((100/$price) * $this->dph);
  16.     }
  17.  
  18.  
  19.     public function calculatePrices(array $prices)
  20.     {
  21.         foreach ($prices as &$price) {
  22.             $price = $this->calculatePrice($price);
  23.         }
  24.  
  25.         return $prices;
  26.     }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment