public static function doSelectReady($time = null) { if (is_null($time)) { $time = time(); } $reservations = ReservationPeer::doSelectReady(false, $time); $actions = array(); foreach ($reservations as $reservation) { foreach ($reservation->getRoomprofile()->getRoom()->getEnergyactions() as $action) { if ($action->getUpDate(strtotime($reservation->getDate())) <= $time) { $actions[$action->getId()] = $action; } } } return $actions; }