Toggle product visibility. No form used here

@param ProductToggleVisibilityEvent $event
766035
public function toggleVisibility(ProductToggleVisibilityEvent $event)
    {
        $product = $event->getProduct();

        $product
            ->setDispatcher($this->eventDispatcher)
            ->setVisible($product->getVisible() ? false : true)
            ->save()
            ;

        $event->setProduct($product);
    }
313043
public function onDisplayWorkspace(DisplayToolEvent $event)
    {
        $workspace = $event->getWorkspace();

        $content = $this->templating->render(
            'ClarolineCoreBundle:workspace:analytics.html.twig', [
                'workspace' => $workspace,
            ]
        );

        $event->setContent($content);
        $event->stopPropagation();
    }
901367
public void setAverageVisible(final boolean VISIBLE) {
        if (null == averageVisible) {
            _averageVisible = VISIBLE;
            fireUpdateEvent(VISIBILITY_EVENT);
        } else {
            averageVisible.set(VISIBLE);
        }
    }
1009328
public void setTextVisible(final boolean VISIBLE) {
        if (null == textVisible) {
            _textVisible = VISIBLE;
            fireTileEvent(VISIBILITY_EVENT);
        } else {
            textVisible.set(VISIBLE);
        }
    }
514257
public function onDisplay(DisplayToolEvent $event)
    {
        if (!$this->request) {
            throw new NoHttpRequestException();
        }

        $subRequest = $this->request->duplicate(
            array(),
            null,
            array(
                '_controller' => 'ClarolineCoreBundle:Tool\Roles:usersList',
                'workspace' => $event->getWorkspace(),
                'page' => 1,
                'search' => '',
                'max' => 50,
                'order' => 'id'
            )
        );
        $response = $this->httpKernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
        $event->setContent($response->getContent());
    }
1366361
public static function registerPackage(Event $event)
    {
        $installedPackage = $event->getOperation()->getPackage();

        if (!self::isBundle($installedPackage)) {
            return;
        }

        self::enablePackage($installedPackage);
    }
689898
public function onDisplayWorkspaceAgenda(DisplayToolEvent $event)
    {
        $workspace = $event->getWorkspace();
        $content = $this->templating->render('ClarolineOpenBadgeBundle::workspace.html.twig', ['workspace' => $workspace]);

        $event->setContent($content);
    }
882691
@Override
  public void setVisible( boolean bVisible )
  {
    super.setVisible( bVisible );

    if( bVisible )
    {
      registerListeners();
    }
    else
    {
      unregisterListeners();
      _editor.getEditor().requestFocus();
    }
  }
740684
public void setKnobVisible(final boolean VISIBLE) {
        if (null == knobVisible) {
            _knobVisible = VISIBLE;
            fireUpdateEvent(VISIBILITY_EVENT);
        } else {
            knobVisible.set(VISIBLE);
        }
    }
904218
public void setVisibility(com.google.api.ads.admanager.axis.v201808.CustomFieldVisibility visibility) {
        this.visibility = visibility;
    }
619287
public function onDisplayWorkspace(DisplayToolEvent $event)
    {
        $workspace = $event->getWorkspace();

        $content = $this->templating->render(
            'ClarolineCoreBundle:workspace:users.html.twig', [
                'workspace' => $workspace,
                'restrictions' => [
                    'hasUserManagementAccess' => $this->authorization->isGranted('OPEN', $this->om
                        ->getRepository('ClarolineCoreBundle:Tool\AdminTool')
                        ->findOneBy(['name' => 'user_management'])
                    ),
                ],
            ]
        );

        $event->setContent($content);
        $event->stopPropagation();
    }
1284603
public static void setVisible(HTMLElement element, boolean visible) {
        if (element != null) {
            element.style.display = visible ? "" : "none";
        }
    }
472019
public function beforeRender(Event $event)
    {
        if (!array_key_exists('_serialize', $this->viewVars) &&
            in_array($this->response->type(), ['application/json', 'application/xml'])
        ) {
            $this->set('_serialize', true);
        }
    }
553021
public void setAlarmsVisible(final boolean VISIBLE) {
        if (null == alarmsVisible) {
            _alarmsVisible = VISIBLE;
            fireTileEvent(REDRAW_EVENT);
        } else {
            alarmsVisible.set(VISIBLE);
        }
    }
47199
public void setSectionsAlwaysVisible(final boolean VISIBLE) {
        if (null == sectionsAlwaysVisible) {
            _sectionsAlwaysVisible = VISIBLE;
            fireTileEvent(REDRAW_EVENT);
        } else {
            sectionsAlwaysVisible.set(VISIBLE);
        }
    }
679895
public function setAccessorVisibility($visibility)
    {
        $visibility = strtolower($visibility);
        if (!in_array($visibility, self::$validVisibilities)) {
            $visibility = self::DEFAULT_VISIBILITY;
        }

        $this->accessorVisibility = $visibility;
    }
630961
@Override protected void onVisibilityChanged(View changedView, int visibility) {
    super.onVisibilityChanged(changedView, visibility);
    if (changedView != this) {
      return;
    }

    if (visibility == View.VISIBLE) {
      resume();
    } else {
      pause();
    }
  }