Example #1
0
 /**
  * Remove Item from collection
  * @param Item $itemToRemove
  * @return int
  */
 public function removeItem(Item $itemToRemove)
 {
     foreach ($this->items as $key => $item) {
         /** @var Item $item */
         if ($item->getAuthorAndTitle() === $itemToRemove->getAuthorAndTitle()) {
             unset($this->items[$key]);
         }
     }
     return $this->count();
 }