<?php 

class tagComponents extends sfComponents
{
  
  public function executeTagNavigator() {
	
  }
  
  public function executePlayer() {
	$ref = '013002';
  	$film_slug = 'apres-lui';

  	// retrieve infos in database
  	$query = Doctrine_Query::create()
      ->from('ThdFilm F')
      ->leftJoin('F.images I ')
      ->leftJoin('F.videos V')
      ->where("F.ref='{$ref}'");
    $this->film = $query->execute()->getFirst();
	  if (!$this->film) return sfView::NONE;

	  // retrieve video infos
	  $videos = $this->film->getVideos();
	  $this->filmVideo = ($videos) ? $videos[0] : null;

  	return sfView::SUCCESS;
  }

  public function executeSuggestionFilmList() {
		$this->tag = Array('score' => 3);
	  $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.ref ASC')
      ->limit(0,10);
    $this->mostTaggedFilms = $query->execute();
    $this->videoPath = sfConfig::get('app_player_videoPath');
  }
  
}