QControlBase::AddChildControl PHP Method

AddChildControl() public method

public AddChildControl ( QControl $objControl )
$objControl QControl
    public function AddChildControl(QControl $objControl)
    {
        $this->blnModified = true;
        $this->objChildControlArray[$objControl->ControlId] = $objControl;
        $objControl->objParentControl = $this;
    }

Usage Example

 /**
  * Sets the parent control for this control
  * @param QControl|QControlBase $objControl The control which has to be set as this control's parent
  */
 public function SetParentControl($objControl)
 {
     // Mark this object as modified
     $this->MarkAsModified();
     // Mark the old parent (if applicable) as modified
     if ($this->objParentControl) {
         $this->objParentControl->RemoveChildControl($this->ControlId, false);
     }
     // Mark the new parent (if applicable) as modified
     if ($objControl) {
         $objControl->AddChildControl($this);
     }
 }