protected function setContainer(HTML_QuickForm2_Container $container = null)
    {
        if (null !== $container) {
            $check = $container;
            do {
                if ($this === $check) {
                    throw new HTML_QuickForm2_InvalidArgumentException(
                        'Cannot set an element or its child as its own container'
                    );
                }
            } while ($check = $check->getContainer());
            if (null !== $this->container && $container !== $this->container) {
                $this->container->removeChild($this);
            }
        }
        $this->container = $container;
        if (null !== $container) {
            $this->updateValue();
        }
    }
protected function setContainer(HTML_QuickForm2_Container $container = null)
    {
        if (null !== $container) {
            $check = $container;
            do {
                if ($this === $check) {
                    throw new HTML_QuickForm2_InvalidArgumentException(
                        'Cannot set an element or its child as its own container'
                    );
                }
            } while ($check = $check->getContainer());
            if (null !== $this->container && $container !== $this->container) {
                $this->container->removeChild($this);
            }
        }
        $this->container = $container;
        if (null !== $container) {
            $this->updateValue();
        }
    }
protected function setContainer ( HTML_QuickForm2_Container $ container = null ) { if ( null !== $ container ) { $ check = $ container ; do { if ( $ this === $ check ) { throw new HTML_QuickForm2_InvalidArgumentException ( 'Cannot set an element or its child as its own container' ) ; } } while ( $ check = $ check -> getContainer ( ) ) ; if ( null !== $ this -> container && $ container !== $ this -> container ) { $ this -> container -> removeChild ( $ this ) ; } } $ this -> container = $ container ; if ( null !== $ container ) { $ this -> updateValue ( ) ; } }
Adds the link to the element containing current

@param    HTML_QuickForm2_Container  Element containing the current one,
null if the link should really be
removed (if removing from container)
@throws   HTML_QuickForm2_InvalidArgumentException   If trying to set a
child of an element as its container
Adds the link to the element containing current