bookCount; } private function setBookCount($newCount) { $this->bookCount = $newCount; } public function getBook($bookNumberToGet) { if ( (is_numeric($bookNumberToGet)) && ($bookNumberToGet <= $this->getBookCount())) { return $this->books[$bookNumberToGet]; } else { return NULL; } } public function addBook(Book $book_in) { $this->setBookCount($this->getBookCount() + 1); $this->books[$this->getBookCount()] = $book_in; return $this->getBookCount(); } public function removeBook(Book $book_in) { $counter = 0; while (++$counter <= $this->getBookCount()) { if ($book_in->getAuthorAndTitle() == $this->books[$counter]->getAuthorAndTitle()) { for ($x = $counter; $x < $this->getBookCount(); $x++) { $this->books[$x] = $this->books[$x + 1]; } $this->setBookCount($this->getBookCount() - 1); } } return $this->getBookCount(); } } ?>