public function setId($id = null)
    {
        if (is_null($id)) {
            $id = self::generateId($this->getName());
        } else {
            self::storeId($id);
        }
        $this->attributes['id'] = (string)$id;
        return $this;
    }
public function setId($id = null)
    {
        if (is_null($id)) {
            $id = self::generateId($this->getName());
        } else {
            self::storeId($id);
        }
        $this->attributes['id'] = (string)$id;
        return $this;
    }
public function setId ( $ id = null ) { if ( is_null ( $ id ) ) { $ id = self :: generateId ( $ this -> getName ( ) ) ; } else { self :: storeId ( $ id ) ; } $ this -> attributes [ 'id' ] = ( string ) $ id ; return $ this ; }
Sets the elements id

Please note that elements should always have an id in QuickForm2 and
therefore it will not be possible to remove the element's id or set it to
an empty value. If id is not explicitly given, it will be autogenerated.

@param    string  Element's id, will be autogenerated if not given
@return   HTML_QuickForm2_Node
Sets the elements id