11 use Magento\Sales\Api\Data\ShipmentSearchResultInterfaceFactory as SearchResultFactory;
42 private $collectionProcessor;
56 $this->collectionProcessor = $collectionProcessor ?: $this->getCollectionProcessor();
67 public function get(
$id)
73 if (!isset($this->registry[
$id])) {
75 $entity = $this->metadata->getNewInstance()->load(
$id);
78 __(
"The entity that was requested doesn't exist. Verify the entity and try again.")
85 return $this->registry[
$id];
97 $searchResult = $this->searchResultFactory->create();
101 return $searchResult;
114 $this->metadata->getMapper()->delete(
$entity);
116 unset($this->registry[
$entity->getEntityId()]);
117 }
catch (\Exception $e) {
147 $this->metadata->getMapper()->save(
$entity);
149 }
catch (\Exception $e) {
153 return $this->registry[
$entity->getEntityId()];
163 return $this->metadata->getNewInstance();
172 private function getCollectionProcessor()
174 if (!$this->collectionProcessor) {
179 return $this->collectionProcessor;
save(\Magento\Sales\Api\Data\ShipmentInterface $entity)
getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria)
__construct(Metadata $metadata, SearchResultFactory $searchResultFactory, CollectionProcessorInterface $collectionProcessor=null)