/** * Validate that $account equals this instance * * @param Account $account * @return bool */ public function equals(Account $account) { if ($this->getNumber() != $account->getNumber() || $this->getType() != $account->getType() || $this->getName() != $account->getName()) { return false; } return true; }
/** * Add account * * @param Account $account * @return void */ public function addAccount(Account $account) { $nr = intval($account->getNumber()); $this->accounts[$nr] = $account; }