From 49a85afc06a3c5231d1ef64cfb4247144efa22dd Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Fri, 7 Sep 2012 14:33:08 -0400 Subject: [PATCH] Refactor --- airtime_mvc/application/models/Show.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index edee46359..7b56569db 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -877,14 +877,11 @@ SQL; public function getShowDays() { - $showDays = CcShowDaysQuery::create()->filterByDbShowId($this->getId())->find(); - - $days = array(); - foreach ($showDays as $showDay) { - array_push($days, $showDay->getDbDay()); - } - - return $days; + $showDays = CcShowDaysQuery::create()->filterByDbShowId( + $this->getId())->find(); + return array_map( function($showDay) { + return $showDay->getDbDay(); + }, $showDays); } /* Only used for shows that aren't repeating.