<?php

class viewSearchListAction extends sfAction {

  public function execute($request) {
  	// Parse request parameters
    $format = $request->getRequestFormat();
    $this->text = (string) $request->getParameter('text');    
    $this->filter = (string) $request->getParameter('filter', 'all');
    $pageNb = (int) $this->getRequestParameter('page_nb', 1);
    $this->pageIndex = $pageNb -1;
    $this->pageNbItems = 10;
    $this->indexNbItems = 2;
    $this->videoPath = sfConfig::get('app_player_videoPath');
    
    $query = Doctrine_Query::create()
      ->from('ThdFilm F')
      ->leftJoin('F.images I ')
      ->leftJoin('F.videos V')
      //->where("cu.code='{$culture}' AND mo.code='{$module}' AND ms.code='{$section}'")
      ->orderBy('F.id DESC')
      ->limit(0,10);
    $this->searchFilms = $query->execute();
    
    
    return sfView::SUCCESS;
  }
}