src/FondOfSpryker/Zed/AvailabilityAlert/Business/Model/SubscriptionManager.php
public function subscribe(
        AvailabilityAlertSubscriptionTransfer $availabilityAlertSubscriptionTransfer
    ) {
        
        $availabilityAlertSubscriptionTransfer->requireEmail();
        $availabilityAlertSubscriptionTransfer->requireFkProductAbstract();
        $availabilityAlertSubscriptionTransfer->requireFkLocale();
        $availabilityAlertSubscriptionTransfer->getFkStore();

        $availabilityAlertSubscriptionEntity = $this->queryContainer
            ->querySubscriptionByEmailAndIdProductAbstract(
                $availabilityAlertSubscriptionTransfer->getEmail(),
                $availabilityAlertSubscriptionTransfer->getFkProductAbstract()
            )->findOne();

        if ($availabilityAlertSubscriptionEntity === null) {
            $availabilityAlertSubscriptionEntity = new FosAvailabilityAlertSubscription();
            $availabilityAlertSubscriptionEntity->setEmail($availabilityAlertSubscriptionTransfer->getEmail())
                ->setFkProductAbstract($availabilityAlertSubscriptionTransfer->getFkProductAbstract());
        }

        $availabilityAlertSubscriptionEntity->setStatus(FosAvailabilityAlertSubscriptionTableMap::COL_STATUS_PENDING)
            ->setFkLocale($availabilityAlertSubscriptionTransfer->getFkLocale())
            ->setFkStore($availabilityAlertSubscriptionTransfer->getFkStore())
            ->setSentAt(null)
            ->save();
    }
public function subscribe(
        AvailabilityAlertSubscriptionTransfer $availabilityAlertSubscriptionTransfer
    ) {
        
        $availabilityAlertSubscriptionTransfer->requireEmail();
        $availabilityAlertSubscriptionTransfer->requireFkProductAbstract();
        $availabilityAlertSubscriptionTransfer->requireFkLocale();
        $availabilityAlertSubscriptionTransfer->getFkStore();

        $availabilityAlertSubscriptionEntity = $this->queryContainer
            ->querySubscriptionByEmailAndIdProductAbstract(
                $availabilityAlertSubscriptionTransfer->getEmail(),
                $availabilityAlertSubscriptionTransfer->getFkProductAbstract()
            )->findOne();

        if ($availabilityAlertSubscriptionEntity === null) {
            $availabilityAlertSubscriptionEntity = new FosAvailabilityAlertSubscription();
            $availabilityAlertSubscriptionEntity->setEmail($availabilityAlertSubscriptionTransfer->getEmail())
                ->setFkProductAbstract($availabilityAlertSubscriptionTransfer->getFkProductAbstract());
        }

        $availabilityAlertSubscriptionEntity->setStatus(FosAvailabilityAlertSubscriptionTableMap::COL_STATUS_PENDING)
            ->setFkLocale($availabilityAlertSubscriptionTransfer->getFkLocale())
            ->setFkStore($availabilityAlertSubscriptionTransfer->getFkStore())
            ->setSentAt(null)
            ->save();
    }
@param \Generated\Shared\Transfer\AvailabilityAlertSubscriptionTransfer $availabilityAlertSubscriptionTransfer

@return void