{@inheritdoc}

@param EventObserver $observer
332312
public function execute(EventObserver $observer)
    {
        if (!$this->config->isDisplayInMenu()) {
            return;
        }
        /** @var \Magento\Framework\Data\Tree\Node $menu */
        $menu = $observer->getData('menu');

        $categories = $this->categoryCollectionFactory->create()
            ->addAttributeToSelect(['name', 'url_key'])
            ->excludeRoot()
            ->addVisibilityFilter();

        $tree = $categories->getTree();

        $rootNode = new TreeNode(
            [
                'id'   => 'blog-node-root',
                'name' => $this->config->getMenuTitle(),
                'url'  => $this->config->getBaseUrl()
            ],
            'id',
            $menu->getTree(),
            null
        );
        //@todo find correct way to add class
        if ($menu->getPositionClass()) {
            $menu->setPositionClass('blog-mx' . $menu->getPositionClass());
        } else {
            $menu->setPositionClass('blog-mx nav' . $menu->getPositionClass());
        }
        $menu->addChild($rootNode);

        foreach ($tree as $category) {
            if (isset($tree[$category->getParentId()])) {
                $parentNode = $tree[$category->getParentId()]->getData('node');
            } else {
                $parentNode = $rootNode;
            }

            $node = new TreeNode(
                [
                    'id'   => 'blog-node-' . $category->getId(),
                    'name' => $category->getName(),
                    'url'  => $category->getUrl()
                ],
                'id',
                $menu->getTree(),
                $parentNode
            );

            if ($parentNode) {
                $parentNode->addChild($node);
            } else {
                $menu->addChild($node);
            }

            $category->setData('node', $node);
        }
    }
422503
public function controllerActionLayoutLoadBefore(Varien_Event_Observer $observer)
    {
        if (!$this->_getHelper()->isActive()) {
            return;
        }
        
        $updateModel = $observer->getLayout()->getUpdate();
        $handles = $updateModel->getHandles();
        $allowedEsi = $this->_getHelper()->getIsEsiAllowed();
        foreach ($handles as $handle) {
            if ($handle == 'customer_logged_in' 
                && !$this->_getHelper()->getIsInternal()) {
                $updateModel->removeHandle($handle);
                // Emulate always guest session
                $updateModel->addHandle('customer_logged_out');
            }
            
            if ($handle == 'default' && !$this->_getHelper()->getIsInternal()) {
                $updateModel->addHandle('default_varnish');
            }
            
            if ($allowedEsi && strtolower($handle) === $handle) {
                // Add handle only if handle is not starting from UPPERCASE code
                $updateModel->addHandle($handle . '_esi');
            }
        }
    }
438500
public function handle(AttributeCodeAndValueAwareObserverInterface $observer)
    {

        // set the observer
        $this->setObserver($observer);

        // replace the passed attribute value into the tax class ID
        return $this->getSubject()->getTaxClassIdByTaxClassName($observer->getAttributeValue());
    }
554183
final public function attach($observer)
  {
    if (!in_array($observer, $this->_observers)) {
      array_push($this->_observers, $observer);
    }
    return $this;
  }
572980
@Override
    public void addObserver(final Observer<S, T> observer) {
        synchronized (OBSERVER_LOCK) {
            if (observers.contains(observer)) {
                LOGGER.warn("Skip observer registration. Observer[" + observer + "] is already registered!");
                return;
            }
            observers.add(observer);
        }
    }
1039186
public function attach(Observer $observer, $type = 'default')
    {
        if (!isset($this->observers[$type])) {
            $this->observers[$type] = [];
        }
        $this->observers[$type][] = $observer;
        return $this;
    }
1146166
public function detachObserver(ObserverInterface $observer){
		$this->connection->detachObserver($observer);
		$this->observers->detach($observer);
		$e = new NeevoException;
		$e->detachObserver($observer);
	}
415661
private function setEventSubscribers(string $eventName, array $eventSubscribers): self
    {
        $this->subscribers[$eventName] = $eventSubscribers;

        return $this;
    }
194572
public function detach(ObserverInterface $observer)
    {
        $observers = $this->getObservers();

        foreach ($observer->getEvents() as $event) {
            $count = count($observers[$event]);

            for ($i = 0; $i < $count; $i++) {
                if ($observers[$event][$i] == $observer) {
                    unset($observers[$event][$i]);
                }
            }
        }

        $this->setObservers($observers);
    }
661001
public void setObserver(Map<String, Object> observer) {
        removeEntriesStartingWith(OBSERVER);
        eventMap.putAll(observer);
    }
1272572
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        try {
            $object = $observer->getEvent()->getDataObject();
            $productId = $object->getId();
            $emailCatalog = $this->catalogFactory->create();
            if ($item = $emailCatalog->loadProductById($productId)) {
                //if imported delete from account
                if ($item->getImported()) {
                    $this->deleteFromAccount($productId);
                }
            }
        } catch (\Exception $e) {
            $this->helper->debug((string)$e, []);
        }
    }
244174
public function detach(EventObserverInterface $observer)
    {
        $key = $this->getRegistrationKey($observer);

        if (array_key_exists($key, $this->observers)){
            unset($this->observers[$key]);
        }
    }
293508
function detach($observer)
    {
        if (!is_a($observer, 'Log_observer') ||
            !isset($this->_listeners[$observer->_id])) {
            return false;
        }

        unset($this->_listeners[$observer->_id]);

        return true;
    }
1273295
public function AttachObserver($listener)
	{
		if ($listener) {
			$this->_observers[] =& $listener;
			if ($this->_masterAdapter) $this->_masterAdapter->AttachObserver($listener);
		}
		
	}
275046
public void unregister(EventObserver<?> observer){
        for (Map.Entry<Class, Set<EventObserver>> entry : observers.entrySet()) {
            entry.getValue().remove(observer);
        }

    }
424057
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $subscriber = $observer->getEvent()->getSubscriber();
        $email = $subscriber->getEmail();
        $websiteId = $this->storeManager->getStore($subscriber->getStoreId())
            ->getWebsiteId();
        $apiEnabled = $this->helper->isEnabled($websiteId);

        /*
         * Remove contact.
         */
        if ($apiEnabled) {
            try {
                //register in queue with importer
                $this->importerFactory->create()->registerQueue(
                    \Dotdigitalgroup\Email\Model\Importer::IMPORT_TYPE_CONTACT,
                    $email,
                    \Dotdigitalgroup\Email\Model\Importer::MODE_CONTACT_DELETE,
                    $websiteId
                );
                $contactModel = $this->contactFactory->create()
                    ->loadByCustomerEmail($email, $websiteId);
                if ($contactModel->getId()) {
                    //remove contact
                    $this->contactResource->delete($contactModel);
                }
            } catch (\Exception $e) {
                $this->helper->debug((string)$e, []);
            }
        }

        return $this;
    }
514880
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $grid = $observer->getBlock();

        /**
         * \Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Grid
         */
        if ($grid instanceof \Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Grid) {
            $grid->addColumnAfter(
                'expiration_date',
                [
                    'header' => __('Expiration date'),
                    'index' => 'expiration_date',
                    'type' => 'datetime',
                    'default' => '',
                    'align' => 'center',
                    'width' => '160'
                ],
                'created_at'
            )->addColumnAfter(
                'generated_by_dotmailer',
                [
                    'header' => __('Generated By dotmailer'),
                    'index' => 'generated_by_dotmailer',
                    'type' => 'options',
                    'default' => '',
                    'options' => ['null' => 'No', '1' => 'Yes'],
                    'width' => '30',
                    'align' => 'center',
                    'filter_condition_callback' =>
                        [$this->couponGridFiltererFactory->create(), 'filterByGeneratedByDotmailer']
                ],
                'expiration_date'
            );
        }
    }