File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class Contact
13
13
14
14
/**
15
15
* Contact constructor.
16
- * @param null $item
16
+ * @param \stdClass| null $item
17
17
*/
18
18
public function __construct ($ item = null )
19
19
{
Original file line number Diff line number Diff line change @@ -26,6 +26,28 @@ public function getEntityMap()
26
26
];
27
27
}
28
28
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
+
29
51
public function loadEntity ($ data )
30
52
{
31
53
return new Vip (
You can’t perform that action at this time.
0 commit comments