Exemplo n.º 1
0
 /**
  * Returns an instance of this class
  * (this class uses the singleton pattern)
  *
  * @return Elios_Service_Thetvdb_Adapter
  */
 public static function getInstance()
 {
     if (!isset(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
 /**
  * Get availiable Mirrors
  * @return array
  */
 public function getAvailableMirror()
 {
     return $this->adapter->getAvailableMirror($this->mirrortype);
 }
Exemplo n.º 3
0
<?php

/*
 * TheTvDb Service Setup
 */
require_once dirname(__FILE__) . '/Adapter.php';
$tvdb_adapter = Elios_Service_Thetvdb_Adapter::getInstance();
$tvdb_adapter->setApiKey("APIKEY");
$tvdb = new Elios_Service_Thetvdb_Thetvdb();
/*
 * Get the current mirror
 */
$mirror = $tvdb->getAvailableMirror();
/*
 * Get the current server time
 * store this value in database for future updates
 */
$time = $tvdb->getServerTime();
$seriesT = new Elios_Service_Thetvdb_Series();
/*
 * Search a serie by name
 */
$series = $seriesT->findByName("South Park", "en");
foreach ($series as $serie) {
    echo $serie->nom . "&nbsp;" . $serie->thetvdb_id . '<br/>';
}
/*
 * Now we use thedvdb_id to get full serie data
 * Elios_Service_Thetvdb_Serie attributes:
 * 
 * public $thetvdb_id;