public function printMiniWiki(SimplePerson $person) { $result = sprintf('<div class="myList"><b>%s</b><br><i>Born in %s</i><br><label>', $person->getName(), $person->getBornIn()->format('Y')); $result .= $person->getDescription(); $result .= '</label></div>'; return $result; }
/** * @param string $name * @param string $bornIn * @param string $rawText * @return SimplePerson */ private function createNewSimplePerson($name, $bornIn, $rawText) { $person = new SimplePerson(); $person->setName($name); $person->setBornIn(new \DateTime("{$bornIn}-01-01 00:00:00")); $person->setDescription($rawText); return $person; }