Skip to content

Commit a1cf8d0

Browse files
authored
Merge pull request #47 from ukfast/master
Merge in UKFast Master
2 parents 30de55e + dc77be3 commit a1cf8d0

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

src/Account/Entities/Contact.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Contact
1313

1414
/**
1515
* Contact constructor.
16-
* @param null $item
16+
* @param \stdClass|null $item
1717
*/
1818
public function __construct($item = null)
1919
{

src/eCloud/VipClient.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,28 @@ public function getEntityMap()
2626
];
2727
}
2828

29+
public function getInternalIp(Vip $vip)
30+
{
31+
if (empty($vip->ipAddressId)) {
32+
return null;
33+
}
34+
35+
return $this->ipAddresses()->getById($vip->ipAddressId)->ipAddress;
36+
}
37+
38+
public function getFloatingIp(Vip $vip)
39+
{
40+
if (!empty($vip->ipAddressId)) {
41+
$floatingIp = $this->floatingIps()->getAll(['resource_id' => $vip->ipAddressId]);
42+
43+
if (count($floatingIp) > 0) {
44+
return $floatingIp[0];
45+
}
46+
}
47+
48+
return null;
49+
}
50+
2951
public function loadEntity($data)
3052
{
3153
return new Vip(

0 commit comments

Comments
 (0)