/** * Converts Prize properties to Array * * return array */ public function toArray() { $output = array('sponsor' => $this->getSponsorName(), 'prize' => $this->getPrizeTitle(), 'tweet_message' => $this->getTweetMessage()); if (null !== $this->getWinner()) { $output['winner'] = $this->winner->toArray(); } return $output; }