module/Core/src/Grid/Core/View/Helper/ViewWidget.php
public function addWidget( $widget, $service, $priority = null )
    {
        if ( ! isset( $this->widgets[$widget] ) )
        {
            $this->widgets[$widget] = new PriorityQueue;
        }

        if ( ! is_a( $service, static::WIDGET_INTERFACE, true ) )
        {
            throw new \InvalidArgumentException( sprintf(
                '%s: $service must implement "%s"',
                __METHOD__,
                static::WIDGET_INTERFACE
            ) );
        }

        $this->widgets[$widget]->insert(
            $service,
            null === $priority ? 1 : (int) $priority
        );

        return $this;
    }
public function addWidget( $widget, $service, $priority = null )
    {
        if ( ! isset( $this->widgets[$widget] ) )
        {
            $this->widgets[$widget] = new PriorityQueue;
        }

        if ( ! is_a( $service, static::WIDGET_INTERFACE, true ) )
        {
            throw new \InvalidArgumentException( sprintf(
                '%s: $service must implement "%s"',
                __METHOD__,
                static::WIDGET_INTERFACE
            ) );
        }

        $this->widgets[$widget]->insert(
            $service,
            null === $priority ? 1 : (int) $priority
        );

        return $this;
    }
public function addWidget ( $ widget , $ service , $ priority = null ) { if ( ! isset ( $ this -> widgets [ $ widget ] ) ) { $ this -> widgets [ $ widget ] = new PriorityQueue ; } if ( ! is_a ( $ service , static :: WIDGET_INTERFACE , true ) ) { throw new \ InvalidArgumentException ( sprintf ( '%s: $service must implement "%s"' , __METHOD__ , static :: WIDGET_INTERFACE ) ) ; } $ this -> widgets [ $ widget ] -> insert ( $ service , null === $ priority ? 1 : ( int ) $ priority ) ; return $ this ; }
Add a widget

@param   string      $widget
@param   string      $service
@param   int|null    $priority
@return  ViewWidget
Add a widget