
<?php

class partialsComponents extends sfComponents {

  public function executeUserPanel() {
    $this->user = $this->getUser();
    if (!$this->user->isAuthenticated()) return sfView::NONE;
  }

  public function executeNavigation() {
    $this->user = $this->getUser();
    if (!$this->user->isAuthenticated()) return sfView::NONE;
  }

  public function executeSearch() {

  }

  public function executeFilmItem() {
    // FIXME
    $this->tag = Array('score' => 3);

    // Get image filename
    $images = $this->film->getImages();
    $this->imageFilename = null;

    if ($images) {
      $image = $images[0];
      $this->imageFilename = $image->getFile();
    }

    // Get video filename
    $videos = $this->film->getVideos();
    $this->videoFilename = null;

    if ($videos) {
      $video = $videos[0];
      $this->videoFilename = $video->getFile();
    }
  }
}
