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

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

@return mixed The modified value
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());
    }
1153680
public function addValueChangedListener(ValueChangedListenerInterface $listener)
    {
        if (!$this->listeners->hasItem($listener)) {
            $this->listeners->push($listener);
        }
    }
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;
    }
657702
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        try {
            $wishlistItem = $observer->getEvent()->getItem();
            $emailWishlist = $this->emailWishlistCollection->create()
                ->getWishlistById($wishlistItem->getWishlistId());

            if ($emailWishlist) {
                $count = $emailWishlist->getItemCount();
                //update wishlist count and set to modified
                $emailWishlist->setItemCount(--$count);
                $emailWishlist->setWishlistModified(1);
                $this->emailWishlistResource->save($emailWishlist);
            }
        } catch (\Exception $e) {
            $this->helper->log((string)$e, []);
        }
    }
981916
public function setValue($value, EntityInterface $entity = null)
    {
        $attribute_validator = $this->getAttribute()->getValidator();
        $validation_result = $attribute_validator->validate($value, $entity);

        if ($validation_result->getSeverity() <= IncidentInterface::NOTICE) {
            $previous_native_value = $this->toNative();
            $this->value = $validation_result->getSanitizedValue();

            if (!$this->sameValueAs($previous_native_value)) {
                $value_changed_event = $this->createValueHolderChangedEvent($previous_native_value);
                $this->propagateValueChangedEvent($value_changed_event);
            }

            if ($this->value instanceof CollectionInterface) {
                $this->value->addListener($this);
            }
            if ($this->value instanceof EntityList) {
                $this->value->addEntityChangedListener($this);
            }
        }

        return $validation_result;
    }
352902
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $additional = $observer->getAdditional();
        $conditions = (array) $additional->getConditions();
        $conditions = array_merge_recursive($conditions, [$this->getShopgateCondition()]);
        $additional->setConditions($conditions);

        return $this;
    }
329777
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $subscriber = $observer->getEvent()->getSubscriber();
        $this->isSubscriberNew = $subscriber->isObjectNew();
        $email = $subscriber->getEmail();
        $storeId = $subscriber->getStoreId();
        $subscriberStatus = $subscriber->getSubscriberStatus();
        $websiteId = $this->storeManager->getStore($subscriber->getStoreId())
            ->getWebsiteId();

        //api is enabled
        if (!$this->helper->isEnabled($websiteId)) {
            return $this;
        }

        try {
            $contactEmail = $this->contactFactory->create()
                ->loadByCustomerEmail($email, $websiteId);

            //update the contact
            $contactEmail->setStoreId($storeId)
                ->setSubscriberStatus($subscriberStatus);

            // only for subscribers
            if ($subscriberStatus == \Magento\Newsletter\Model\Subscriber::STATUS_SUBSCRIBED) {
                //Set contact as subscribed
                $contactEmail->setSubscriberImported(null)
                    ->setIsSubscriber('1');

                //Subscriber subscribed when it is suppressed in table then re-subscribe
                if ($contactEmail->getSuppressed()) {
                    $this->importerFactory->registerQueue(
                        \Dotdigitalgroup\Email\Model\Importer::IMPORT_TYPE_SUBSCRIBER_RESUBSCRIBED,
                        ['email' => $email],
                        \Dotdigitalgroup\Email\Model\Importer::MODE_SUBSCRIBER_RESUBSCRIBED,
                        $websiteId
                    );
                    //Set to subscriber imported and reset the subscriber as suppressed
                    $contactEmail->setSubscriberImported(1)
                        ->setSuppressed(null);
                }
                //save contact
                $this->contactResource->save($contactEmail);

                //not subscribed
            } else {
                //skip if contact is suppressed
                if ($contactEmail->getSuppressed()) {
                    return $this;
                }
                $contactEmail->setSubscriberImported(1)
                    ->setIsSubscriber(null);
                //save contact
                $this->contactResource->save($contactEmail);

                //need to confirm enabled, to keep before the subscription data for contentinsight.
                if ($subscriberStatus == \Magento\Newsletter\Model\Subscriber::STATUS_UNCONFIRMED ||
                    $subscriberStatus == \Magento\Newsletter\Model\Subscriber::STATUS_NOT_ACTIVE) {
                    return $this;
                }

                //Add subscriber update to importer queue
                $this->importerFactory->registerQueue(
                    \Dotdigitalgroup\Email\Model\Importer::IMPORT_TYPE_SUBSCRIBER_UPDATE,
                    ['email' => $email, 'id' => $contactEmail->getId()],
                    \Dotdigitalgroup\Email\Model\Importer::MODE_SUBSCRIBER_UPDATE,
                    $websiteId
                );
            }

            // fix for a multiple hit of the observer. stop adding the duplicates on the automation
            $emailReg = $this->registry->registry($email . '_subscriber_save');
            if ($emailReg) {
                return $this;
            }
            $this->registry->unregister($email . '_subscriber_save'); // additional measure
            $this->registry->register($email . '_subscriber_save', $email);
            //add subscriber to automation
            $this->addSubscriberToAutomation($email, $subscriber, $websiteId);
        } 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]);
        }
    }
1367405
public function set_observer($observer) {
        $this->observer = $observer;
        foreach ($this->questionattempts as $qa) {
            $qa->set_observer($observer);
        }
    }
773919
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $order = $observer->getEvent()->getOrder();

        //verify pagseguro transaction
        if ($order->getStatus() == 'pagseguro_iniciado') {
            $orderId = $order->getId();
            $environment = $this->_scopeConfig->getValue('payment/pagseguro/environment');
            
            //save order in pagseguro_orders table
            $this->saveOrderAndEnvironment($orderId, $environment);

            //$this->getEnvironmentName($environment);
            $this->updateSalesOrderGridEnvironment($orderId, $environment);
        }

        return $this;
    }
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;
    }
786126
protected function notify(ObservationContainerInterface $container): ? ObservationContainerInterface
    {
        foreach ( $this->observers as $current ) {
            $current->update($container);
        }

        return $container;
    }
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());
    }
974613
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $dataObject = $observer->getEvent()->getDataObject();

        if ($dataObject->getCustomerId()
            && $dataObject->getStatusId()
            == \Magento\Review\Model\Review::STATUS_APPROVED
        ) {
            $customerId = $dataObject->getCustomerId();
            $this->helper->setConnectorContactToReImport($customerId);
            //save review info in the table
            $this->registerReview($dataObject);
            $store = $this->storeManager->getStore($dataObject->getStoreId());
            $storeName = $store->getName();
            $website = $this->storeManager->getStore($store)->getWebsite();
            $customer = $this->customerFactory->create();
            $this->customerResource->load($customer, $customerId);
            //if api is not enabled
            if (!$this->helper->isEnabled($website)) {
                return $this;
            }

            $programId
                = $this->helper->getWebsiteConfig('connector_automation/visitor_automation/review_automation');
            if ($programId) {
                $automation = $this->automationFactory->create();
                $automation->setEmail($customer->getEmail())
                    ->setAutomationType(\Dotdigitalgroup\Email\Model\Sync\Automation::AUTOMATION_TYPE_NEW_REVIEW)
                    ->setEnrolmentStatus(\Dotdigitalgroup\Email\Model\Sync\Automation::AUTOMATION_STATUS_PENDING)
                    ->setTypeId($dataObject->getReviewId())
                    ->setWebsiteId($website->getId())
                    ->setStoreName($storeName)
                    ->setProgramId($programId);
                $this->automationResource->save($automation);
            }
        }

        return $this;
    }
1248545
protected function accessible($observer): bool
    {
        if (!method_exists($observer, 'getAccessor')) {
            return true;
        }

        return in_array(get_class($this->app), (array) $observer::getAccessor());
    }
1271363
public function execute(Observer $observer)
    {
        /** @var Subscriber $subscriber */
        $subscriber = $observer->getSubscriber();

        try {
            $store = $this->storeManager->getStore($subscriber->getStoreId());

            if ($subscriber->getCustomerId()) {
                $this->customerEventHandler->store(
                    $subscriber->getCustomerId(),
                    $store->getWebsiteId(),
                    $store->getId()
                );
            } else {
                $this->subscriptionEventHandler->store(
                    $subscriber,
                    $store->getWebsiteId(),
                    $store->getId(),
                    $this->subscriptionEventHandler->getEventType($observer->getEvent()->getName())
                );
            }
        } catch (\Exception $e) {
            $this->logger->warning('Emartech\\Emarsys\\Observers\\SubscriptionObserver: ' . $e->getMessage());
        }
    }
850173
public function detach($observer)
	{
		$retval = false;

		$key = array_search($observer, $this->_observers);

		if ($key !== false)
		{
			unset($this->_observers[$key]);
			$retval = true;

			foreach ($this->_methods as &$method)
			{
				$k = array_search($key, $method);

				if ($k !== false)
				{
					unset($method[$k]);
				}
			}
		}

		return $retval;
	}