From 52cb85786d0c7d60d77d491693da5dc79d759116 Mon Sep 17 00:00:00 2001 From: alphayax Date: Wed, 3 Feb 2016 21:36:45 +0100 Subject: [PATCH] Add System service --- freebox/api/v3/Model.php | 22 +++++++++++++++++ freebox/api/v3/config/DHCP.php | 3 ++- freebox/api/v3/models/DhcpConfig.php | 35 ++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 freebox/api/v3/Model.php create mode 100644 freebox/api/v3/models/DhcpConfig.php diff --git a/freebox/api/v3/Model.php b/freebox/api/v3/Model.php new file mode 100644 index 0000000..bd2fb24 --- /dev/null +++ b/freebox/api/v3/Model.php @@ -0,0 +1,22 @@ + $value){ + if( property_exists( static::class, $property)){ + $this->$property = $value; + } + } + } + +} \ No newline at end of file diff --git a/freebox/api/v3/config/DHCP.php b/freebox/api/v3/config/DHCP.php index 7cbcce5..461284b 100644 --- a/freebox/api/v3/config/DHCP.php +++ b/freebox/api/v3/config/DHCP.php @@ -1,5 +1,6 @@ getAuthService( self::API_DHCP_CONFIG); $rest->GET(); - return $rest->getCurlResponse(); + return new DhcpConfig( $rest->getCurlResponse()['result']); } /** diff --git a/freebox/api/v3/models/DhcpConfig.php b/freebox/api/v3/models/DhcpConfig.php new file mode 100644 index 0000000..fcffbdc --- /dev/null +++ b/freebox/api/v3/models/DhcpConfig.php @@ -0,0 +1,35 @@ +