/** * @param Budget $budget */ public function setBudget(Budget $budget) { $this->budget = $budget; $this->budgetname = $budget->getName(); }
/** * @param Budget $budget * @return bool */ public function isInvited(Budget $budget) { foreach ($this->invitationsReceived as $i) { if (in_array($i->getStatus(), array('accepted', 'pending', 'manager')) && $i->getBudget()->getId() == $budget->getId()) { return true; } } return false; }