public function delete(StockistInterface $stockist)
    {
        /** @var \Limesharp\Stockists\Api\Data\StockistInterface|\Magento\Framework\Model\AbstractModel $stockist */
        $id = $stockist->getId();
        try {
            unset($this->instances[$id]);
            $this->resource->delete($stockist);
        } catch (ValidatorException $e) {
            throw new CouldNotSaveException(__($e->getMessage()));
        } catch (\Exception $e) {
            throw new StateException(
                __('Unable to remove stockist %1', $id)
            );
        }
        unset($this->instances[$id]);
        return true;
    }
public function delete(StockistInterface $stockist)
    {
        /** @var \Limesharp\Stockists\Api\Data\StockistInterface|\Magento\Framework\Model\AbstractModel $stockist */
        $id = $stockist->getId();
        try {
            unset($this->instances[$id]);
            $this->resource->delete($stockist);
        } catch (ValidatorException $e) {
            throw new CouldNotSaveException(__($e->getMessage()));
        } catch (\Exception $e) {
            throw new StateException(
                __('Unable to remove stockist %1', $id)
            );
        }
        unset($this->instances[$id]);
        return true;
    }
public function delete ( StockistInterface $ stockist ) { /** @var \Limesharp\Stockists\Api\Data\StockistInterface|\Magento\Framework\Model\AbstractModel $stockist */ $ id = $ stockist -> getId ( ) ; try { unset ( $ this -> instances [ $ id ] ) ; $ this -> resource -> delete ( $ stockist ) ; } catch ( ValidatorException $ e ) { throw new CouldNotSaveException ( __ ( $ e -> getMessage ( ) ) ) ; } catch ( \ Exception $ e ) { throw new StateException ( __ ( 'Unable to remove stockist %1' , $ id ) ) ; } unset ( $ this -> instances [ $ id ] ) ; return true ; }
Delete stockist.

@param \Limesharp\Stockists\Api\Data\StockistInterface $stockist
@return bool true on success
@throws \Magento\Framework\Exception\LocalizedException
Delete stockist .