Loader which loads news subscription according to subscribers oxid

@param string $sOxUserId subscribers oxid

@return bool
341933
public function loadFromUserId($sOxUserId)
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sOxId = $oDb->getOne("select oxid from oxnewssubscribed where oxuserid = {$oDb->quote($sOxUserId)} and oxshopid = {$oDb->quote(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopId())}");

        return $this->load($sOxId);
    }
863987
public function delete($sOXID = null)
    {
        if (!$sOXID) {
            $sOXID = $this->getId();
        }

        if (!$this->canDeleteAttribute($sOXID)) {
            return false;
        }

        // remove attributes from articles also
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sOxidQuoted = $oDb->quote($sOXID);
        $sDelete = "delete from oxobject2attribute where oxattrid = " . $sOxidQuoted;
        $oDb->execute($sDelete);

        // #657 ADDITIONAL removes attribute connection to category
        $sDelete = "delete from oxcategory2attribute where oxattrid = " . $sOxidQuoted;
        $oDb->execute($sDelete);

        return parent::delete($sOXID);
    }
413137
public function loadUser($userId)
    {
        $user = $this->userService->loadUser($userId, Language::ALL);

        $userContentInfo = $user->getVersionInfo()->getContentInfo();
        $contentType = $this->contentTypeService->loadContentType($userContentInfo->contentTypeId);

        try {
            $userMainLocation = $this->locationService->loadLocation($userContentInfo->mainLocationId);
            $relations = $this->contentService->loadRelations($user->getVersionInfo());
        } catch (UnauthorizedException $e) {
            // TODO: Hack for special case to allow current logged in user to load him/here self (but not relations)
            if ($user->id == $this->repository->getCurrentUser()->id) {
                $userMainLocation = $this->repository->sudo(
                    function () use ($userContentInfo) {
                        return $this->locationService->loadLocation($userContentInfo->mainLocationId);
                    }
                );
                // user may not have permissions to read related content, for security reasons do not use sudo().
                $relations = array();
            } else {
                throw $e;
            }
        }

        return new Values\CachedValue(
            new Values\RestUser(
                $user,
                $contentType,
                $userContentInfo,
                $userMainLocation,
                $relations
            ),
            array('locationId' => $userContentInfo->mainLocationId)
        );
    }
586815
public function loadPoliciesByUserId($userId)
    {
        $groupIds = $this->fetchUserGroups($userId);
        $groupIds[] = $userId;

        return $this->loadRolesForContentObjects($groupIds);
    }
1029109
public function delete($sOXID = null)
    {
        if ($blDelete = parent::delete($sOXID)) {
            $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
            if ($this->oxorderarticles__oxstorno->value != 1) {
                $this->updateArticleStock($this->oxorderarticles__oxamount->value, $myConfig->getConfigParam('blAllowNegativeStock'));
            }
        }

        return $blDelete;
    }
1149834
protected function _onChangeStockResetCount($sOxid)
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        if ($myConfig->getConfigParam('blUseStock') && $this->oxarticles__oxstockflag->value == 2 &&
            ($this->oxarticles__oxstock->value + $this->oxarticles__oxvarstock->value) <= 0
        ) {
            $this->_onChangeResetCounts(
                $sOxid,
                $this->oxarticles__oxvendorid->value,
                $this->oxarticles__oxmanufacturerid->value
            );
        }
    }
888845
final function throttle(string $userID) {
        if(empty($this->throttling) || $this->client->isOwner($userID)) {
            return null;
        }
        
        if(!$this->throttles->has($userID)) {
            $this->throttles->set($userID, array(
                'start' => \time(),
                'usages' => 0,
                'timeout' => $this->client->addTimer($this->throttling['duration'], function () use ($userID) {
                    $this->throttles->delete($userID);
                })
            ));
        }
        
        return $this->throttles->get($userID);
    }
457637
public function load($oxID)
    {
        if ($blRet = parent::load($oxID)) {
            // convert date's to international format
            $this->oxremark__oxcreate = new \OxidEsales\Eshop\Core\Field(\OxidEsales\Eshop\Core\Registry::getUtilsDate()->formatDBDate($this->oxremark__oxcreate->value), \OxidEsales\Eshop\Core\Field::T_RAW);
        }

        return $blRet;
    }
351112
public function loadOrderArticlesForUser($sOxId)
    {
        if (!$sOxId) {
            $this->clear();

            return;
        }

        $sSelect = "SELECT oxorderarticles.* FROM oxorder ";
        $sSelect .= "left join oxorderarticles on oxorderarticles.oxorderid = oxorder.oxid ";
        $sSelect .= "left join oxarticles on oxorderarticles.oxartid = oxarticles.oxid ";
        $sSelect .= "WHERE oxorder.oxuserid = " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($sOxId);

        $this->selectString($sSelect);
    }
548188
public function addUser($userId)
    {
        if (true === is_numeric($userId) && false === in_array($userId, $this->users)) {
            $this->users[] = (int)$userId;
        }
        return $this;
    }
920699
public function load($oxid)
    {
        //getting at least one field before lazy loading the object
        $this->_addField('oxid', 0);
        $query = $this->buildSelectString([$this->getViewName() . '.oxid' => $oxid]);
        $this->_isLoaded = $this->assignRecord($query);

        return $this->_isLoaded;
    }
498720
public function load(User $user = null): self
    {
        try {
            $contentDrafts = $this->contentService->loadContentDrafts($user);
        } catch (UnauthorizedException $e) {
            // if user has no access content/versionread for one of versions, exception is caught and draft array is empty
            $contentDrafts = [];
        }

        $contentDrafts = array_filter($contentDrafts, function (VersionInfo $version) {
            // Filter out content that has been sent to trash
            return !$version->getContentInfo()->isTrashed();
        });

        $contentTypes = $contentTypeIds = [];
        foreach ($contentDrafts as $contentDraft) {
            $contentTypeIds[] = $contentDraft->getContentInfo()->contentTypeId;
        }

        if (!empty($contentTypeIds)) {
            $contentTypes = $this->contentTypeService->loadContentTypeList(array_unique($contentTypeIds));
        }

        // ContentService::loadContentDrafts returns unsorted list of VersionInfo.
        // Sort results by modification date, descending.
        usort($contentDrafts, function (VersionInfo $a, VersionInfo $b) {
            return $b->modificationDate <=> $a->modificationDate;
        });

        $this->data = array_map(
            function (VersionInfo $versionInfo) use ($contentTypes) {
                return $this->mapContentDraft(
                    $versionInfo,
                    $contentTypes[$versionInfo->getContentInfo()->contentTypeId]
                );
            },
            $contentDrafts
        );

        return $this;
    }
156468
private function isUserContent($contentId)
    {
        try {
            $this->repository->getUserService()->loadUser($contentId);

            return true;
        } catch (NotFoundException $e) {
            return false;
        }
    }
1246722
protected function fetchUserId($fieldId)
    {
        $query = $this->dbHandler->createSelectQuery();
        $query
            ->select(
                $this->dbHandler->quoteColumn('contentobject_id')
            )
            ->from($this->dbHandler->quoteTable('ezcontentobject_attribute'))
            ->where(
                $query->expr->eq(
                    $this->dbHandler->quoteColumn('id', 'ezcontentobject_attribute'),
                    $query->bindValue($fieldId)
                )
            );

        $stmt = $query->prepare();
        $stmt->execute();

        return $stmt->fetchColumn();
    }
56385
public function getSubscriptionByCustomerId($customerId)
    {
        /** @var SubscriptionFbApi $response */
        $response = $this->call(new Request('subscription.get', array('customer_id' => $customerId)), 'DVelopment\FastBill\Model\SubscriptionFbApi');
        $subscriptions = $response->getResponse()->getSubscriptions();

        return reset($subscriptions);
    }
72052
public function loadEditor($editorId)
    {
        if (! is_null($editor = $this->getEditor($editorId))) {
            if ($editor->isUsed()) {
                return true;
            }

            return $editor->load();
        }

        return false;
    }
43121
public function delete($sOxId = null)
    {
        if (!$sOxId) {
            $sOxId = $this->getId();
        }
        if (!$sOxId) {
            return false;
        }

        $blDeleted = parent::delete($sOxId);

        if ($blDeleted) {
            $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
            $sDelete = "delete from oxobject2group where oxobject2group.oxshopid = '" . $this->getShopId() . "' and oxobject2group.oxobjectid = " . $oDb->quote($sOxId);
            $oDb->execute($sDelete);
        }

        return $blDeleted;
    }