示例#1
0
 /**
  * Constructor
  * @since Version 3.9
  * @param int|bool $id The ID of the photo from the provider
  * @param object|bool $Provider The provider of the image, using the \Railpage\Railcams\Provider interface
  */
 public function __construct($id = false, $Provider = false)
 {
     parent::__construct();
     if ($Provider) {
         $this->setProvider($Provider);
     }
     if (filter_var($id, FILTER_VALIDATE_INT)) {
         $this->id = $id;
         if (is_object($this->Provider)) {
             $this->load();
         }
     }
 }
示例#2
0
 /**
  * Constructor
  * @since Version 3.4
  * @param int $id
  */
 public function __construct($id = null)
 {
     parent::__construct();
     $this->GuzzleClient = new Client();
     if ($id != null) {
         $this->id = $id;
         // Fetch Railcam data
         $this->load();
     }
 }
示例#3
0
 /**
  * Constructor
  * @since Version 3.4
  * @param int $id
  */
 public function __construct($id = false)
 {
     parent::__construct();
     if ($id) {
         $this->id = $id;
         // Fetch Railcam data
         try {
             $this->load();
         } catch (Exception $e) {
             throw new Exception($e->getMessage());
         }
     }
 }