fix booklist remove function

This commit is contained in:
ftwbzhao
2015-03-07 14:11:42 +08:00
parent 12145c5605
commit 53f4d364c0
2 changed files with 10 additions and 1 deletions

View File

@@ -25,7 +25,7 @@ class BookList implements \Countable
public function removeBook(Book $bookToRemove)
{
foreach ($this as $key => $book) {
foreach ($this->books as $key => $book) {
/** @var Book $book */
if ($book->getAuthorAndTitle() === $bookToRemove->getAuthorAndTitle()) {
unset($this->books[$key]);