public function hasWidget($nameOrWidget)
    {
        $name = $nameOrWidget instanceof WidgetInterface ? $nameOrWidget->getName() : $nameOrWidget;

        return array_key_exists($name, $this->widgets);
    }
public function hasWidget($nameOrWidget)
    {
        $name = $nameOrWidget instanceof WidgetInterface ? $nameOrWidget->getName() : $nameOrWidget;

        return array_key_exists($name, $this->widgets);
    }
public function hasWidget ( $ nameOrWidget ) { $ name = $ nameOrWidget instanceof WidgetInterface ? $ nameOrWidget -> getName ( ) : $ nameOrWidget ; return array_key_exists ( $ name , $ this -> widgets ) ; }
Returns whether the dashboard has the widget or not.

@param string|WidgetInterface $nameOrWidget
@return bool
Returns whether the dashboard has the widget or not .