-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #503 from ecloud-jay2/master
Surfaces SoftwareClient
- Loading branch information
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace UKFast\SDK\eCloud\Entities; | ||
|
||
use UKFast\SDK\Entity; | ||
|
||
/** | ||
* @property int $id | ||
* @property string $name | ||
* @property string $platform | ||
* @property string $license | ||
*/ | ||
class Software extends Entity | ||
{ | ||
protected $dates = ['createdAt', 'updatedAt']; | ||
|
||
public static $entityMap = [ | ||
'id' => 'id', | ||
'name' => 'name', | ||
'platform' => 'platform', | ||
'license' => 'license', | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace UKFast\SDK\eCloud; | ||
|
||
use UKFast\SDK\eCloud\Entities\Software; | ||
use UKFast\SDK\Entities\ClientEntityInterface; | ||
use UKFast\SDK\Traits\PageItems; | ||
|
||
class SoftwareClient extends Client implements ClientEntityInterface | ||
{ | ||
use PageItems; | ||
|
||
protected $collectionPath = 'v2/software'; | ||
|
||
public function loadEntity($data) | ||
{ | ||
return new Software( | ||
$this->apiToFriendly($data, $this->getEntityMap()) | ||
); | ||
} | ||
|
||
public function getEntityMap() | ||
{ | ||
return Software::$entityMap; | ||
} | ||
} |