Add Widget To Container

@param string $regionBox
@param string|array|WidgetInterface $widget
@param int $priority

@throws \Exception Invalid Widget Provided
@return $this
967832
function addWidget($regionBox, $widget, $priority = 0)
    {
        $this->__validateWidget($widget);

        $regionBox = (string) $regionBox;
        if (!array_key_exists($regionBox, $this->__widgets))
            $this->__widgets[$regionBox] = new PriorityQueue();

        /** @var PriorityQueue $queue */
        $queue = $this->__widgets[$regionBox];
        $queue->insert($widget, $priority);

        return $this;
    }
75609
public function addSubMenu( $attributes = [], $priority = 10 )
    {
        $defaultAttributes = [
            'page_title' => $this->plugin['config']->get('plugin.namespace'),
            'menu_title' => $this->plugin['config']->get('plugin.namespace'),
            'capability' => 'read',
            'menu_slug' => $this->plugin['config']->get('plugin.slug'),
            'parent_slug' => '',
            'controller' => '',
        ];

        $attributes = array_merge($defaultAttributes,$attributes);

        add_action('admin_menu', function () use ($attributes) {
            // Add shortcode support for widgets
            add_submenu_page(
                $attributes['parent_slug'],
                $attributes['page_title'],
                $attributes['menu_title'],
                $attributes['capability'],
                $attributes['menu_slug'],
                function () use ( $attributes ){
                    return $this->executeController($attributes['controller'], $attributes);
                }
            );
        }, $priority);
    }
63054
public function addProvider(Provider $provider, $priority = 0)
    {
        $this->providers[$priority][] = $provider;
        ksort($this->providers);
    }
1310240
public function packStart(SwatWidget $widget)
    {
        if ($widget->parent !== null) {
            throw new SwatException(
                'Attempting to add a widget that already has a parent.'
            );
        }

        array_unshift($this->children, $widget);
        $widget->parent = $this;

        if ($widget->id !== null) {
            $this->children_by_id[$widget->id] = $widget;
        }

        $this->sendAddNotifySignal($widget);
    }
945174
public static function forWidget(Widget $widget): self
    {
        $values = StringUtil::deserialize($widget->bs_inputGroup, true);
        $helper = new static();

        foreach ($values as $entry) {
            if (!strlen($entry['addon'])) {
                continue;
            }

            if ($entry['position'] === 'after') {
                $helper->addAfter($entry['addon']);
            } else {
                $helper->addBefore($entry['addon']);
            }
        }

        return $helper;
    }
1065140
public function updateWidgetMap($widgetMap)
    {
        //parse all widfgetMaps
        foreach ($this->widgetMaps as $key => $_widgetMap) {
            //if this the widgetMap we are looking for
            if ($_widgetMap->getWidgetId() === $widgetMap->getWidgetId()) {
                $this->widgetMaps[$key] = $widgetMap;
                //there no need to continue, we found the slot
                break;
            }
        }

        return $this;
    }
399901
@UiChild(limit = 1, tagname = "valuebox")
	public void setValueBox(ValueBoxBase<T> widget) {
		contents.add(widget);
		setEditor(widget.asEditor());
	}
1128852
public function setPriority($priority)
    {
        if (!$priority instanceof Priority) {
            $priority = new Priority(floatval($priority));
        }
        $this->elements[self::ELEMENT_PRIORITY] = $priority;

        return $this;
    }
871043
public function addWidgetConfig(WidgetConfig $widget)
    {
        if ($widget instanceof WidgetContainerConfig) {
            $this->addContainer($widget);
        } elseif (Development::isEnabled()) {
            $this->checkIsValidWidget($widget);
        }

        $this->widgets[] = $widget;
    }
618412
public function addProvider(PathProviderInterface $provider, $priority = 0)
    {
        $this->providers[$priority][] = $provider;
        $this->sorted                 = null;
    }
226494
public function createService(ServiceManager\ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('config');

        $config = (isset($config['yima_widgetator'])) ? $config['yima_widgetator'] : [];
        $config = (isset($config['widgets'])) ? $config['widgets'] : [];

        $widgetContainer = new RegionBoxContainer;
        $widgetContainer->addWidgets($config);

        return $widgetContainer;
    }
207020
public function addMenu( $attributes = [], $priority = 1 )
    {
        $defaultAttributes = [
            'page_title' => $this->plugin['config']->get('plugin.namespace'),
            'menu_title' => $this->plugin['config']->get('plugin.namespace'),
            'capability' => 'read',
            'menu_slug' => $this->plugin['config']->get('plugin.slug'),
            'icon_url' => '',
            'position' => null,
            'controller' => null,
        ];

        $attributes = array_merge($defaultAttributes,$attributes);

        add_action('admin_menu', function () use ($attributes) {
            // Add shortcode support for widgets
            add_menu_page(
                $attributes['page_title'],
                $attributes['menu_title'],
                $attributes['capability'],
                $attributes['menu_slug'],
                function () use ( $attributes ){
                    return $this->executeController($attributes['controller'], $attributes);
                },
                $attributes['icon_url'],
                $attributes['position']
            );
        }, $priority);
    }
229362
public function addRouter(Router $router, int $priority = null)
	{
		if ($priority !== null) {
			Arrays::slice($this->indexedRouters, $priority, $router);
		} else {
			$this->routers[] = $router;
		}
	}
60562
public function attach(EventManagerInterface $events, $priority = 1)
    {
        $this->listeners[] = $events->attach(ComposerEvent::EVENT_HTML_BODY_PRE, [$this, 'injectLayoutViewModel']);
    }
662694
public function addToolbar($toolbar, $config = array(), $priority = AnEvent::PRIORITY_NORMAL)
    {
        if (! ($toolbar instanceof AnControllerToolbarInterface)) {
            $toolbar = $this->_mixer->getToolbar($toolbar, $config);
        }

        //Add the toolbars
        $this->_toolbars[$toolbar->getIdentifier()->name] = $toolbar;

        //Add the toolbar
        if ($this->inherits('AnMixinEvent')) {
            $this->addEventSubscriber($toolbar, $priority);
        }

        return $this->getMixer();
    }
432014
public function addExtension(ExtensionInterface $extension, $priority = 0)
    {
        $this->extensions[$priority][] = $extension;
        $this->sorted                  = null;
        $this->typeExtensions          = [];
    }
769246
public function addAction(string $hook, ComponentInterface $component, string $handler, int $priority = 10, int $argCount = 1): void {
		$this->actions[] = new Hook($hook, $component, $handler, $priority, $argCount);
	}