public function getById($stockistId)
    {
        if (!isset($this->instances[$stockistId])) {

            /** @var \Limesharp\Stockists\Api\Data\StockistInterface|\Magento\Framework\Model\AbstractModel $stockist */
            $stockist = $this->stockistInterfaceFactory->create();
            $this->resource->load($stockist, $stockistId);
            
            if (!$stockist->getId()) {
                throw new NoSuchEntityException(__('Requested stockist doesn\'t exist'));

           }
            $this->instances[$stockistId] = $stockist;
        }

        return $this->instances[$stockistId];;
    }
public function getById($stockistId)
    {
        if (!isset($this->instances[$stockistId])) {

            /** @var \Limesharp\Stockists\Api\Data\StockistInterface|\Magento\Framework\Model\AbstractModel $stockist */
            $stockist = $this->stockistInterfaceFactory->create();
            $this->resource->load($stockist, $stockistId);
            
            if (!$stockist->getId()) {
                throw new NoSuchEntityException(__('Requested stockist doesn\'t exist'));

           }
            $this->instances[$stockistId] = $stockist;
        }

        return $this->instances[$stockistId];;
    }
public function getById ( $ stockistId ) { if ( ! isset ( $ this -> instances [ $ stockistId ] ) ) { /** @var \Limesharp\Stockists\Api\Data\StockistInterface|\Magento\Framework\Model\AbstractModel $stockist */ $ stockist = $ this -> stockistInterfaceFactory -> create ( ) ; $ this -> resource -> load ( $ stockist , $ stockistId ) ; if ( ! $ stockist -> getId ( ) ) { throw new NoSuchEntityException ( __ ( 'Requested stockist doesn\'t exist' ) ) ; } $ this -> instances [ $ stockistId ] = $ stockist ; } return $ this -> instances [ $ stockistId ] ; ; }
Retrieve Stockist.

@param int $stockistId
@return \Limesharp\Stockists\Api\Data\StockistInterface
@throws \Magento\Framework\Exception\LocalizedException
Retrieve Stockist .