<?php 

class reflexComponents extends sfComponents
{
  
  public function executeTagNavigator() {
  	$ref = '058000';
  	
  	// 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();
	 // if (!$this->film) return sfView::NONE;

	  // retrieve tags infos
	 // $film = $this->film();

	  
	return sfView::SUCCESS;
  
  }
  
  public function executePlayer() {
    $this->film_uniqueid = (string) $request->getParameter('film_uniqueid'); 
  	// retrieve infos in database

  	$query = Doctrine_Query::create()
      ->from('ThdFilm F')
      ->leftJoin('F.images I ')
      ->leftJoin('F.videos V')
      ->where("F.uniqueid='{$film_uniqueid}'");
    $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;
  }

 
}