Files
DesignPatternsPHP/Behavioral/Iterator/Book.php
2015-12-21 07:28:20 -05:00

32 lines
498 B
PHP

<?php
namespace DesignPatterns\Behavioral\Iterator;
class Book
{
private $author;
private $title;
public function __construct($title, $author)
{
$this->author = $author;
$this->title = $title;
}
public function getAuthor()
{
return $this->author;
}
public function getTitle()
{
return $this->title;
}
public function getAuthorAndTitle()
{
return $this->getTitle().' by '.$this->getAuthor();
}
}