public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $entity = $observer->getEntity();

        if ($entity->getVirtualRule() !== null) {
            $this->saveHandler->execute($entity);
        }
    }
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $entity = $observer->getEntity();

        if ($entity->getVirtualRule() !== null) {
            $this->saveHandler->execute($entity);
        }
    }
public function execute ( \ Magento \ Framework \ Event \ Observer $ observer ) { $ entity = $ observer -> getEntity ( ) ; if ( $ entity -> getVirtualRule ( ) !== null ) { $ this -> saveHandler -> execute ( $ entity ) ; } }
Observer listening to magento_catalog_api_data_categoryinterface_save_before

@param \Magento\Framework\Event\Observer $observer The Observer

@return void
Observer listening to magento_catalog_api_data_categoryinterface_save_before