コード例 #1
0
ファイル: Photo.php プロジェクト: bersace/strass
 function direct($throw = true)
 {
     $slug = $this->getRequest()->getParam('photo');
     $t = new Photos();
     try {
         $p = $t->findBySlug($slug);
     } catch (Strass_Db_Table_NotFound $e) {
         if ($throw) {
             throw new Strass_Controller_Action_Exception_NotFound("Photo " . $slug . " inconnue");
         } else {
             return null;
         }
     }
     $this->setBranche($p);
     return $p;
 }