public function remove($widgetCategoryId, $widgetName = false)
    {
        foreach ($this->widgets as $index => $widget) {
            if ($widget->getCategoryId() === $widgetCategoryId) {
                if (!$widgetName || $widget->getName() === $widgetName) {
                    unset($this->widgets[$index]);
                }
            }
        }
    }
public function remove($widgetCategoryId, $widgetName = false)
    {
        foreach ($this->widgets as $index => $widget) {
            if ($widget->getCategoryId() === $widgetCategoryId) {
                if (!$widgetName || $widget->getName() === $widgetName) {
                    unset($this->widgets[$index]);
                }
            }
        }
    }
public function remove ( $ widgetCategoryId , $ widgetName = false ) { foreach ( $ this -> widgets as $ index => $ widget ) { if ( $ widget -> getCategoryId ( ) === $ widgetCategoryId ) { if ( ! $ widgetName || $ widget -> getName ( ) === $ widgetName ) { unset ( $ this -> widgets [ $ index ] ) ; } } } }
Removes one or more widgets from the widget list.

@param string $widgetCategoryId The widget category id. Can be a translation token eg 'General_Visits'
see {@link WidgetConfig::setCategoryId()}.
@param string|false $widgetName The name of the widget to remove eg 'VisitTime_ByServerTimeWidgetName'.
If not supplied, all widgets within that category will be removed.
Removes one or more widgets from the widget list .