code: public function onClear(OnClearEventArgs $event)
      {
          if ((null === $event->getEntityClass()) || ($this->getClassName() === $event->getEntityClass())) {
              $this->defaultGroup = null;
          }
      }
docs: On clear event handler.
  
  @param OnClearEventArgs $event