public function testGetId() { $rows = Program::search('', array()); $row = current($rows); $this->assertEquals('program', strtolower(get_class(Program::get($row['program_disc'])))); $this->assertFalse(Program::get('dummy')); }
} if (isset($_POST['weekofday'])) { $weekofday = $_POST['weekofday']; if ($weekofday != 7) { $options .= " AND WEEKDAY(starttime) = '" . $weekofday . "'"; } } } $options .= " ORDER BY starttime ASC LIMIT 100"; $do_keyword = 0; if ($search != "" || $type != "*" || $category_disc !== false || $station != 0) { $do_keyword = 1; } try { $db = DB::conn(); $programs = Program::search($options, $args); foreach ($programs as $key => $program) { $channel = Channel::get($program['channel_disc']); $programs[$key]['station_name'] = $channel->name; } } catch (Exception $e) { throw $e; } try { $k_category_name = ""; $categories = $db->rows('SELECT * FROM ' . Category::TABLE); $first_category = array('id' => 0, 'name' => "すべて", 'selected' => $category_disc === false ? "selected" : ""); foreach ($categories as $key => $category) { $categories[$key]['name'] = $category['name_jp']; $categories[$key]['selected'] = $category['category_disc'] === $category_disc ? "selected" : ""; if ($category['category_disc'] === $category_disc) {