agreementCollectionFactory = $agreementCollectionFactory; $this->storeManager = $storeManager; $this->scopeConfig = $scopeConfig; } /** * Get list of required Agreement Ids * * @return int[] */ public function getRequiredAgreementIds() { $agreementIds = []; if ($this->scopeConfig->isSetFlag(self::PATH_ENABLED, ScopeInterface::SCOPE_STORE)) { $agreementCollection = $this->agreementCollectionFactory->create(); $agreementCollection->addStoreFilter($this->storeManager->getStore()->getId()); $agreementCollection->addFieldToFilter('is_active', 1); $agreementCollection->addFieldToFilter('mode', AgreementModeOptions::MODE_MANUAL); $agreementIds = $agreementCollection->getAllIds(); } return $agreementIds; } }