freebox_api_php/freebox/utils/Service.php

30 lines
664 B
PHP
Raw Normal View History

2016-02-02 20:34:57 +01:00
<?php
2016-06-24 21:35:56 +02:00
namespace alphayax\freebox\utils;
2016-06-03 22:25:19 +02:00
use alphayax\freebox\utils;
2016-02-02 20:34:57 +01:00
/**
* Class freebox_service
*/
abstract class Service {
2016-06-03 22:25:19 +02:00
/** @var \alphayax\freebox\utils\Application */
2016-02-02 20:34:57 +01:00
protected $application;
/**
* Service constructor.
2016-06-03 22:25:19 +02:00
* @param \alphayax\freebox\utils\Application $application
2016-02-02 20:34:57 +01:00
*/
2016-06-03 22:25:19 +02:00
public function __construct( utils\Application $application){
2016-02-02 20:34:57 +01:00
$this->application = $application;
}
/**
* @param $service
2016-06-03 22:25:19 +02:00
* @return \alphayax\freebox\utils\rest\Rest
2016-02-02 20:34:57 +01:00
*/
protected function getService( $service){
2016-06-21 13:26:05 +02:00
return new utils\rest\Rest( $this->application->getFreeboxApiHost() . $service);
2016-02-02 20:34:57 +01:00
}
}