- /**
- * Loads a specified order payment.
- *
- * @param int $id The order payment ID.
- * @return \Magento\Sales\Api\Data\OrderPaymentInterface Order payment interface.
- * @throws NoSuchEntityException
- * @throws \Magento\Framework\Exception\InputException
- */
- public function get($id)
- {
- if (!$id) {
- throw new \Magento\Framework\Exception\InputException(__('ID required'));
- }
- if (!isset($this->registry[$id])) {
- $entity = $this->metaData->getNewInstance()->load($id);
- if (!$entity->getId()) {
- throw new NoSuchEntityException(__('Requested entity doesn\'t exist'));
- }
- $this->registry[$id] = $entity;
- }
- return $this->registry[$id];