Will be invoked by a observer it has been registered for.

@param \TechDivision\Import\Observers\ObserverInterface $observer The observer

@return mixed The modified value
967387
public function handle(AttributeCodeAndValueAwareObserverInterface $observer)
    {

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

        // replace the passed attribute value into the page layout
        return $this->getSubject()->getPageLayoutByValue($observer->getAttributeValue());
    }
382907
public function execute(Observer $observer) {
        
        // Get a potential 3D Secure redirect url from session
        $redirectUrl = $this->session->get3DSRedirect();

        // Get the card id charge flag
        $isCardIdCharge = $this->session->getCardIdChargeFlag() == 'cardIdCharge';

        // Handle a 3D Secure redirection if needed
        if ($this->isUrl($redirectUrl)) {

            // Exit to force redirection in case of card id charge
            if ($isCardIdCharge) {
                // Unset the session variable
                $this->session->unsCardIdChargeFlag();
                exit();
            }
        }
    }
507611
public function execute(Observer $observer) {
        // Get the order
        $order = $observer->getEvent()->getOrder();

        // Get 3D Secure setting
        $is3ds = (int) $this->gatewayConfig->isVerify3DSecure();

        // Force the order status to what is in config for Frames only
        if ($is3ds == 1 && $order->getPayment()->getMethod() == 'checkout_com') {
            // Update order status
            $order->setStatus($this->gatewayConfig->getNewOrderStatus());
        }

        return $this;
    }
1367405
public function set_observer($observer) {
        $this->observer = $observer;
        foreach ($this->questionattempts as $qa) {
            $qa->set_observer($observer);
        }
    }
948748
public function execute(Observer $observer)
    {
        if (!$this->scopeConfig->getValue(self::CONFIG_PATH_REDIRECT_TO_CHECKOUT, ScopeInterface::SCOPE_STORE)) {
            return;
        }

        /** @var Http $request */
        $request = $observer->getData('request');
        $request->setParam('return_url', $this->url->getUrl('checkout'));
    }
361821
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $customer = $observer->getEvent()->getCustomer();
        $email = $customer->getEmail();
        $websiteId = $customer->getWebsiteId();
        $apiEnabled = $this->helper->isEnabled($websiteId);
        $customerSync = $this->helper->isCustomerSyncEnabled($websiteId);

        /*
         * Remove contact.
         */
        if ($apiEnabled && $customerSync) {
            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;
    }
244174
public function detach(EventObserverInterface $observer)
    {
        $key = $this->getRegistrationKey($observer);

        if (array_key_exists($key, $this->observers)){
            unset($this->observers[$key]);
        }
    }
736616
protected function observe($observer)
    {
        if (method_exists($observer, 'saving')) {
            $this->hook('saving', array($observer, 'saving'));
        }

        if (method_exists($observer, 'saved')) {
            $this->hook('saved', array($observer, 'saved'));
        }

        if (method_exists($observer, 'filtering')) {
            $this->hook('filtering', array($observer, 'filtering'));
        }

        if (method_exists($observer, 'filtered')) {
            $this->hook('filtered', array($observer, 'filtered'));
        }

        if (method_exists($observer, 'removing')) {
            $this->hook('removing', array($observer, 'removing'));
        }

        if (method_exists($observer, 'removed')) {
            $this->hook('removed', array($observer, 'removed'));
        }

        if (method_exists($observer, 'searching')) {
            $this->hook('searching', array($observer, 'searching'));
        }

        if (method_exists($observer, 'searched')) {
            $this->hook('searched', array($observer, 'searched'));
        }

        if (method_exists($observer, 'attaching')) {
            $this->hook('attaching', array($observer, 'attaching'));
        }

        if (method_exists($observer, 'attached')) {
            $this->hook('attached', array($observer, 'attached'));
        }

        if (method_exists($observer, 'initialized')) {
            $this->hook('initialized', array($observer, 'initialized'));
        }
    }
646895
public function attach(ObserverInterface $observer)
    {
        $observers = $this->getObservers();

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

        $this->setObservers($observers);
    }
319575
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $productModel = $observer->getEvent()->getDataObject();
        $productId = $productModel->getId();

        $emailCatalogModel = $this->catalogFactory->create();
        $emailCatalog = $emailCatalogModel->loadProductById($productId);

        if ($emailCatalog->getId()) {
            //update email catalog item when imported
            if ($emailCatalog->getImported()) {
                $emailCatalog->setModified(1);
                $this->catalogResource->save($emailCatalog);
            }
        } else {
            //create new email catalog item
            $emailCatalogModel->setProductId($productId);
            $this->catalogResource->save($emailCatalogModel);
        }

        return $this;
    }
1023359
public function attach(ObserverInterface $observer): void
    {
        $key = spl_object_hash($observer);

        if ( array_key_exists($key, $this->observers) ) {
            throw new ObservatoryException(
                'Provided observer already known, hash: '.$key
            );
        }

        $this->observers[$key] = $observer;
    }
911812
public function attach(EventObserverInterface $observer)
    {
        $key = $this->getRegistrationKey($observer);

        if (empty($this->observers[$key])) {
            $this->observers[$key] = $observer;
        }
    }
633119
protected function convertObserverToString(EventInterface $event)
    {
        $observers = array();
        foreach ($event->getObservers() as $observer) {
            $observers[] = $this->stringConverter->convertToString($observer);
        }

        return implode(', ', $observers);
    }
1339543
public function detach(ObserverInterface $observer): SubjectInterface
    {
        if (is_int(($key = array_search($observer, $this->observer, true)))) {
            unset($this->observer[$key]);
        }
        return $this;
    }
681550
public function registerObserver(Garp_Util_Observer $observer, $name = false) {
        $name = $name ?: $observer->getName();
        $this->_observers[$name] = $observer;
        return $this;
    }
732141
public static function getObserver($table = null) {
        if (!$table) { $table = static::$lastTableName; }
        return (isset(static::$observers[$table]) && static::$observers[$table]) ? static::$observers[$table] : null;
    }
382855
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        /** define local working data */
        /** @var \Magento\Catalog\Model\Product $product */
        $product = $observer->getData(self::DATA_PRODUCT);

        /** perform processing */
        if ($product instanceof \Magento\Catalog\Model\Product) {
            $product->setSpecialPrice(null);
        }
    }