-
Notifications
You must be signed in to change notification settings - Fork 82
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 #7 from bkolobara/master
Add PersistentVolumeClaim
- Loading branch information
Showing
4 changed files
with
51 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,31 @@ | ||
<?php namespace Maclof\Kubernetes\Collections; | ||
|
||
use Maclof\Kubernetes\Models\PersistentVolumeClaim; | ||
|
||
class PersistentVolumeClaimCollection extends Collection | ||
{ | ||
/** | ||
* The constructor. | ||
* | ||
* @param array $data | ||
*/ | ||
public function __construct(array $data) | ||
{ | ||
parent::__construct($this->getPersistentVolumeClaims(isset($data['items']) ? $data['items'] : [])); | ||
} | ||
|
||
/** | ||
* Get an array of persistent volume claims. | ||
* | ||
* @param array $items | ||
* @return array | ||
*/ | ||
protected function getPersistentVolumeClaims(array $items) | ||
{ | ||
foreach ($items as &$item) { | ||
$item = new PersistentVolumeClaim($item); | ||
} | ||
|
||
return $items; | ||
} | ||
} |
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,6 @@ | ||
<?php namespace Maclof\Kubernetes\Models; | ||
|
||
class PersistentVolumeClaim extends Model | ||
{ | ||
|
||
} |
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,13 @@ | ||
<?php namespace Maclof\Kubernetes\Repositories; | ||
|
||
use Maclof\Kubernetes\Collections\PersistentVolumeClaimCollection; | ||
|
||
class PersistentVolumeClaimRepository extends Repository | ||
{ | ||
protected $uri = 'persistentvolumeclaims'; | ||
|
||
protected function createCollection($response) | ||
{ | ||
return new PersistentVolumeClaimCollection($response); | ||
} | ||
} |