Widget/Widget.php
public function addWidget(ItemInterface $item)
    {
        // Check Security
        if ($this->checkRole) {
            if ($item->getRole() && !$this->security->isGranted($item->getRole())) {
                return $this;
            }
        }

        // Add
        $this->widgets[$item->getId()] = $item;

        return $this;
    }
public function addWidget(ItemInterface $item)
    {
        // Check Security
        if ($this->checkRole) {
            if ($item->getRole() && !$this->security->isGranted($item->getRole())) {
                return $this;
            }
        }

        // Add
        $this->widgets[$item->getId()] = $item;

        return $this;
    }
public function addWidget ( ItemInterface $ item ) { // Check Security if ( $ this -> checkRole ) { if ( $ item -> getRole ( ) && ! $ this -> security -> isGranted ( $ item -> getRole ( ) ) ) { return $ this ; } } // Add $ this -> widgets [ $ item -> getId ( ) ] = $ item ; return $ this ; }
Add Widget.

@param ItemInterface $item

@return $this
Add Widget .