AdminCTTopMenuItemController::processNoFollow PHP Method

processNoFollow() public method

Processes toggling no_follow values through admin list
public processNoFollow ( )
    public function processNoFollow()
    {
        /** @var CTTopMenuItem $topMenuItem */
        $topMenuItem = $this->loadObject();
        if (!Validate::isLoadedObject($topMenuItem)) {
            $this->errors[] = Tools::displayError('An error occurred while updating menu item information.');
        }
        $topMenuItem->no_follow = !$topMenuItem->no_follow;
        if (!$topMenuItem->update()) {
            $this->errors[] = Tools::displayError('An error occurred while updating menu item information.');
        }
        Tools::redirectAdmin(self::$currentIndex . '&token=' . $this->token);
    }