public function setType($type)
    {
        if(is_array($type) === true) {
            $type    = $type[key($type)];
        }

        $this->types = array_flip($this->types);
        if (isset($this->types[$type]) === true) {

            $this->widget = $type;

        }

        return $this;
    }