| 1 | <?php |
||
| 5 | class Container |
||
| 6 | { |
||
| 7 | const STATE_UNKNOWN = 'unknown'; |
||
| 8 | const STATE_RUNNING = 'running'; |
||
| 9 | const STATE_EXITED = 'exited'; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | private $name; |
||
| 15 | /** |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | private $image; |
||
| 19 | /** |
||
| 20 | * @var array |
||
| 21 | */ |
||
| 22 | private $hosts; |
||
| 23 | /** |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | private $state; |
||
| 27 | /** |
||
| 28 | * @var array |
||
| 29 | */ |
||
| 30 | private $ports; |
||
| 31 | /** |
||
| 32 | * @var string |
||
| 33 | */ |
||
| 34 | private $componentName; |
||
| 35 | /** |
||
| 36 | * @var string |
||
| 37 | */ |
||
| 38 | private $ipAddress; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param string $name |
||
| 42 | * @param string $image |
||
| 43 | * @param string $state |
||
| 44 | * @param array $hosts |
||
| 45 | * @param array $ports |
||
| 46 | * @param string $componentName |
||
| 47 | * @param null $ipAddress |
||
| 48 | */ |
||
| 49 | public function __construct($name, $image, $state = self::STATE_UNKNOWN, array $hosts = [], array $ports = [], $componentName = null, $ipAddress = null) |
||
| 50 | { |
||
| 51 | $this->name = $name; |
||
| 52 | $this->image = $image; |
||
| 53 | $this->hosts = $hosts; |
||
| 54 | $this->state = $state; |
||
| 55 | $this->ports = $ports; |
||
| 56 | $this->componentName = $componentName; |
||
| 57 | $this->ipAddress = $ipAddress; |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @return string |
||
| 62 | */ |
||
| 63 | public function getName() |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @return string |
||
| 70 | */ |
||
| 71 | public function getImage() |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @return array |
||
| 78 | */ |
||
| 79 | public function getHosts() |
||
| 83 | |||
| 84 | /** |
||
| 85 | * @return string |
||
| 86 | */ |
||
| 87 | public function getState() |
||
| 91 | |||
| 92 | /** |
||
| 93 | * @return array |
||
| 94 | */ |
||
| 95 | public function getPorts() |
||
| 99 | |||
| 100 | /** |
||
| 101 | * @return string |
||
| 102 | */ |
||
| 103 | public function getComponentName() |
||
| 107 | |||
| 108 | /** |
||
| 109 | * @return string |
||
| 110 | */ |
||
| 111 | public function getIpAddress() |
||
| 115 | } |
||
| 116 |