11 use Magento\Sales\Api\Data\OrderAddressSearchResultInterfaceFactory as SearchResultFactory;
42 private $collectionProcessor;
57 $this->collectionProcessor = $collectionProcessor ?: $this->getCollectionProcessor();
68 public function get(
$id)
74 if (!isset($this->registry[
$id])) {
76 $entity = $this->metadata->getNewInstance()->load(
$id);
79 __(
"The entity that was requested doesn't exist. Verify the entity and try again.")
86 return $this->registry[
$id];
98 $searchResult = $this->searchResultFactory->create();
102 return $searchResult;
115 $this->metadata->getMapper()->delete(
$entity);
117 unset($this->registry[
$entity->getEntityId()]);
118 }
catch (\Exception $e) {
148 $this->metadata->getMapper()->save(
$entity);
150 }
catch (\Exception $e) {
154 return $this->registry[
$entity->getEntityId()];
164 return $this->metadata->getNewInstance();
173 private function getCollectionProcessor()
175 if (!$this->collectionProcessor) {
180 return $this->collectionProcessor;
getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria)
__construct(Metadata $metadata, SearchResultFactory $searchResultFactory, CollectionProcessorInterface $collectionProcessor=null)
save(\Magento\Sales\Api\Data\OrderAddressInterface $entity)