Behavioral\Iterator restructured

This commit is contained in:
Antonio Spinelli
2014-03-24 10:40:08 -03:00
parent 3e515daa0f
commit d225a43de7
8 changed files with 240 additions and 166 deletions

View File

@@ -0,0 +1,32 @@
<?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();
}
}