Update Service
This commit is contained in:
parent
717624fbb9
commit
be71cccfa2
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
namespace alphayax\freebox\api\v3;
|
||||
use alphayax\freebox\utils\Application;
|
||||
use alphayax\freebox\utils;
|
||||
|
||||
/**
|
||||
* Class freebox_service
|
||||
*/
|
||||
abstract class Service {
|
||||
|
||||
/** @var Application */
|
||||
/** @var \alphayax\freebox\utils\Application */
|
||||
protected $application;
|
||||
|
||||
/// Freebox API host URI
|
||||
|
@ -15,28 +15,28 @@ abstract class Service {
|
|||
|
||||
/**
|
||||
* Service constructor.
|
||||
* @param Application $application
|
||||
* @param \alphayax\freebox\utils\Application $application
|
||||
*/
|
||||
public function __construct( Application $application){
|
||||
public function __construct( utils\Application $application){
|
||||
$this->application = $application;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $service
|
||||
* @return \alphayax\utils\Rest
|
||||
* @return \alphayax\freebox\utils\rest\Rest
|
||||
*/
|
||||
protected function getService( $service){
|
||||
return new \alphayax\utils\Rest( static::API_HOST . $service);
|
||||
return new utils\rest\Rest( static::API_HOST . $service);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $service
|
||||
* @param bool $isJson
|
||||
* @param bool $returnAsArray
|
||||
* @return \alphayax\freebox\utils\rest\RestAuth
|
||||
* @return utils\rest\RestAuth
|
||||
*/
|
||||
protected function getAuthService( $service, $isJson = true, $returnAsArray = true){
|
||||
$rest = new \alphayax\freebox\utils\rest\RestAuth( static::API_HOST . $service, $isJson, $returnAsArray);
|
||||
$rest = new utils\rest\RestAuth( static::API_HOST . $service, $isJson, $returnAsArray);
|
||||
$rest->setSessionToken( $this->application->getSessionToken());
|
||||
return $rest;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue