Ejemplo n.º 1
0
 /**
  * Gets SK ITC Bundle DTD Document Element
  *
  * @param string $name
  *        	SK ITC Bundle DTD Document Element Name
  * @return \SK\ITCBundle\ORM\DTD\Element[]
  */
 public function getElement($name = null)
 {
     if (NULL === $this->element) {
         $this->element = new \ArrayIterator();
     }
     if (NULL !== $name) {
         if (!$this->getElement()->offsetExists($name)) {
             $source = $this->getSource()->getElement($name);
             $element = new Element($this, $name, $source);
             $this->setElement($element);
         }
         return $this->element->offsetGet($name);
     } else {
         foreach ($this->getSource()->getElement() as $name => $source) {
             $element = new Element($this, $name, $source);
             $this->setElement($element);
         }
     }
     return $this->element;
 }