diff --git a/image.php b/image.php index 6e4e22a..01a5bff 100644 --- a/image.php +++ b/image.php @@ -16,17 +16,32 @@ class image extends objectStructs public function __construct($vars) { - $this->imageName = (isset($vars['image']) ? $vars['image'] : - (isset($vars['name']) ? $vars['name'] : - (iiset($vars['imageName'] ? $vars['imageName'] : "" ) ) ) ) ; - if (isset( $vars['imageBasic']->annotations) ) - $annotations = $vars['imageBasic']->annotations; - elseif (isset($vars['annotations'])) - $annotations = $vars['annotations']; + 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']; $this->annotations = new imageAnnotations($annotations); - if (isset($vars['imageConfig'])) - $this->config = new imageConfig($vars['imageConfig']); + 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']; + } + } public function getHostControllerName()