function addChild(WFView $view) { if (!$view instanceof WFPassword) { throw new WFException("Only WFPassword child views are accepted."); } if ($this->confirmPasswordId !== NULL) { throw new WFException("WFPassword accepts only one child."); } $this->confirmPasswordId = $view->id(); $this->setValueForKey(false, 'autocomplete'); $view->setValueForKey(false, 'autocomplete'); return parent::addChild($view); }
/** * To implement our prototype functionality, we need to detect when a child object named "<id>Prototype" has been added. * * If a prototype object is detected, we set up the prototype for the WFDynamic. * * @param object WFView The object being added. */ function addChild(WFView $view) { if ($view->id() == "{$this->id}Prototype") { $this->setPrototype($view); } else { // add new view to the "parentView" object $parentView = $this->calculateParent(); if ($parentView) { $parentView->addChild($view); } else { parent::addChild($view); } } }
/** * Add a child view to this view. * * @param object A WFView object to add. */ function addChild(WFView $view) { $this->children[$view->id()] = $view; $view->setParent($this); }