/** * indexAction * * @return void */ public function indexAction() { $log = Zend_Registry::get('log'); $log->info('index action of Podcast controller'); $sessions = Tg_Session::fetchAll(); $this->view->sessions = $sessions; $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setViewSuffix('pxml'); }
public function testSaveNewSessionWithExistingSubObjectsShouldSave() { $session = Tg_Session::fetch(); $session->campaign = Tg_Campaign::fetch(self::TEST_CAMPAIGN_ID); $session->media = Tg_Media::fetch(self::TEST_MEDIA_ID); $session->author = Tg_Media::fetch(self::TEST_AUTHOR_ID); $session->date = new Zend_Date(); $session->description = "Test Description"; $session->synopsis = "Test Synopsis"; $session->tags = array('grand', 'newTag'); $session->save(); $fetchedSession = Tg_Session::fetch($session->id); $this->assertEquals($session, $fetchedSession); }
/** * Gets all gaming sessions and returns them in an array * * @return array */ public static function fetchAll() { $session = new Tg_Session(); $sessionTable = $session->_getSessionTable(); $rowset = $sessionTable->fetchAll(); $sessions = array(); foreach ($rowset as $row) { $session = new Tg_Session(); $session->_loadFromRow($row); $sessions[] = $session; } return $sessions; }