#42: allow updates to menuitems
This commit is contained in:
parent
0068654885
commit
674adcba60
14 changed files with 258 additions and 7 deletions
|
@ -88,9 +88,14 @@ class FoodVendor
|
|||
/**
|
||||
* @return Collection<int, MenuItem>
|
||||
*/
|
||||
public function getMenuItems(): Collection
|
||||
public function getMenuItems(bool $withDeleted = false): Collection
|
||||
{
|
||||
return $this->menuItems;
|
||||
if ($withDeleted) {
|
||||
return $this->menuItems;
|
||||
}
|
||||
return $this->menuItems->filter(
|
||||
static fn(MenuItem $item): bool => $item->isDeleted() === false
|
||||
);
|
||||
}
|
||||
|
||||
public function addMenuItem(MenuItem $menuItem): static
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue