public function checkTaxes(Client $client) { $haveDecl = false; foreach ($this->declarations as $k => $v) { if ($v->getClient() == $client) { echo 'Check for ' . $client->getName() . ' EGN: ' . $client->getEGN() . PHP_EOL; $haveDecl = true; foreach ($v->getAssetsList() as $key => $value) { echo 'Asset: ' . $value->getName() . ' Price: ' . $value->getPrice() . ' Tax:' . $value->getTax() . PHP_EOL; } echo PHP_EOL; } } if (!$haveDecl) { throw new Exception('No Declaration of this person !!'); } else { $s = new Service($this->employees[0], $client, 'Check'); $this->services[] = $s; self::store($s, 'Checks', count($this->services)); } }