Exemple #1
0
 /**
  * Add a child component
  * 
  * @param Component $newComponent
  * 
  * @return void
  */
 public function addComponent(Component $newComponent)
 {
     $this->_components[$newComponent->_localID] = $newComponent;
     $newComponent->_parent = $this;
     if ($this->_id !== null) {
         $newComponent->_id = $this->resolveChildID($newComponent->_localID);
         $newComponent->setChildIDs();
     } else {
         if ($this instanceof Page) {
             $newComponent->_id = $newComponent->_localID;
             $newComponent->setChildIDs();
         } else {
             $newComponent->_id = null;
         }
     }
     $newComponent->addedToParent();
 }