Exemple #1
0
 /**
  * Adds a new property to this template.
  *
  * @param $node The property node
  */
 public function addProperty(PropertyNode $node)
 {
     if ($node->getKey() == null) {
         $this->propertyMap[$this->curIndex] = $node;
         $node->setKey($this->curIndex);
         $this->curIndex++;
     } else {
         //If there is already a property with the same key, remove it from the children list
         if (isset($this->propertyMap[$node->getKey()])) {
             $this->removeChild($this->propertyMap[$node->getKey()]);
         }
         $this->propertyMap[$node->getKey()] = $node;
     }
     parent::addChild($node);
 }