13 use Magento\Vault\Api\Data\PaymentTokenSearchResultsInterfaceFactory;
17 use Magento\Vault\Model\ResourceModel\PaymentToken\CollectionFactory;
58 private $collectionProcessor;
84 $this->collectionProcessor = $collectionProcessor ?: $this->getCollectionProcessor();
99 $searchResults = $this->searchResultsFactory->create();
103 return $searchResults;
114 $tokenModel = $this->paymentTokenFactory->create();
115 $this->resourceModel->load($tokenModel, $entityId);
125 public function delete(Data\PaymentTokenInterface
$paymentToken)
129 if (empty($tokenModel->getPublicHash())) {
133 $tokenModel->setIsActive(
false);
134 $tokenModel->setIsVisible(
false);
164 foreach ($filterGroup->
getFilters() as $filter) {
165 $condition = $filter->getConditionType() ? $filter->getConditionType() :
'eq';
166 $collection->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]);
176 private function getCollectionProcessor()
178 if (!$this->collectionProcessor) {
180 \
Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface::class
183 return $this->collectionProcessor;
save(Data\PaymentTokenInterface $paymentToken)
__construct(PaymentTokenResourceModel $resourceModel, PaymentTokenFactory $paymentTokenFactory, FilterBuilder $filterBuilder, SearchCriteriaBuilder $searchCriteriaBuilder, PaymentTokenSearchResultsInterfaceFactory $searchResultsFactory, CollectionFactory $collectionFactory, CollectionProcessorInterface $collectionProcessor=null)
addFilterGroupToCollection(FilterGroup $filterGroup, Collection $collection)
getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria)