podmanImageManager/image.php

62 lines
1.9 KiB
PHP
Raw Normal View History

2020-10-06 02:11:36 -04:00
<?php
namespace podmanImageManager;
use \objectStructs\objectStructs;
class image extends objectStructs
{
/** @var imageAnnotations */
public $annotations;
/** @var imageConfig */
public $config;
/** @var string name of image */
public $image;
public function __construct($vars)
{
2020-12-01 21:31:19 -05:00
if (is_array($vars))
{
$this->imageName = (isset($vars['image']) ? $vars['image'] :
(isset($vars['name']) ? $vars['name'] :
(isset($vars['imageName']) ? $vars['imageName'] : "" ) ) ) ;
if (isset( $vars['imageBasic']->annotations) )
$annotations = $vars['imageBasic']->annotations;
elseif (isset($vars['annotations']))
$annotations = $vars['annotations'];
2020-10-06 02:11:36 -04:00
$this->annotations = new imageAnnotations($annotations);
2020-12-01 21:31:19 -05:00
if (isset($vars['imageConfig']))
$this->config = new imageConfig($vars['imageConfig']);
}
elseif (is_object($vars))
{
$this->imageName = (isset($vars->image ) ? $vars->image :
(isset($vars->name) ? $vars->name :
(isset($vars->imageName) ? $vars->imageName : "" ) ) ) ;
if (isset( $vars->imageBasic->annotations) )
$annotations = $vars['imageBasic']->annotations;
elseif (isset($vars['annotations']))
$annotations = $vars['annotations'];
}
2020-10-06 02:11:36 -04:00
}
2020-11-29 16:04:45 -05:00
2020-11-29 16:05:10 -05:00
public function getHostControllerName()
2020-11-29 16:04:45 -05:00
{
if (isset($this->annotations->hostController))
return $this->annotations->hostController;
else
return false;
}
2020-11-29 16:05:10 -05:00
public function getClientControllerName()
2020-11-29 16:04:45 -05:00
{
if (isset($this->annotations->clientController))
return $this->annotations->clientController;
else
return false;
}
2020-10-06 02:11:36 -04:00
}