/**
  * @see \MetaborStd\ArrayConvertableInterface::toArray()
  */
 public function toArray()
 {
     if ($this->object instanceof MetadataInterface) {
         return $this->object->getMetadata();
     } elseif ($this->object instanceof ArrayConvertableInterface) {
         return $this->object->toArray();
     } elseif ($this->object instanceof \ArrayIterator) {
         return $this->object->getArrayCopy();
     } elseif ($this->object instanceof \ArrayObject) {
         return $this->object->getArrayCopy();
     } elseif ($this->object instanceof \Traversable) {
         return iterator_to_array($this->object);
     } else {
         throw new \RuntimeException('Unable to get MetaData!');
     }
 }
 /**
  * {@inheritdoc}
  */
 public function listObserved() : array
 {
     return $this->observedList->getArrayCopy();
 }
示例#3
0
 /**
  * Show me Template
  * @param string $templateFileName
  */
 public function render($templateFileName)
 {
     $template = self::$template->loadTemplate($templateFileName);
     echo $template->render($this->variables->getArrayCopy());
 }