public function getById($thesaurusId)
    {
        if (!isset($this->thesaurusRepositoryById[$thesaurusId])) {
            /** @var ThesaurusInterface $thesaurus */
            $thesaurus = $this->thesaurusFactory->create()->load($thesaurusId);
            if (!$thesaurus->getThesaurusId()) {
                throw NoSuchEntityException::singleField('thesaurusId', $thesaurusId);
            }

            $this->thesaurusRepositoryById[$thesaurusId] = $thesaurus;
        }

        return $this->thesaurusRepositoryById[$thesaurusId];
    }
public function getById($thesaurusId)
    {
        if (!isset($this->thesaurusRepositoryById[$thesaurusId])) {
            /** @var ThesaurusInterface $thesaurus */
            $thesaurus = $this->thesaurusFactory->create()->load($thesaurusId);
            if (!$thesaurus->getThesaurusId()) {
                throw NoSuchEntityException::singleField('thesaurusId', $thesaurusId);
            }

            $this->thesaurusRepositoryById[$thesaurusId] = $thesaurus;
        }

        return $this->thesaurusRepositoryById[$thesaurusId];
    }
public function getById ( $ thesaurusId ) { if ( ! isset ( $ this -> thesaurusRepositoryById [ $ thesaurusId ] ) ) { /** @var ThesaurusInterface $thesaurus */ $ thesaurus = $ this -> thesaurusFactory -> create ( ) -> load ( $ thesaurusId ) ; if ( ! $ thesaurus -> getThesaurusId ( ) ) { throw NoSuchEntityException :: singleField ( 'thesaurusId' , $ thesaurusId ) ; } $ this -> thesaurusRepositoryById [ $ thesaurusId ] = $ thesaurus ; } return $ this -> thesaurusRepositoryById [ $ thesaurusId ] ; }
Retrieve a thesaurus by its ID

@SuppressWarnings(PHPMD.StaticAccess) Mandatory to throw the exception via static access to be compliant
with Magento Extension Quality Program

@param int $thesaurusId id of the thesaurus

@return \Smile\ElasticsuiteThesaurus\Api\Data\ThesaurusInterface
@throws \Magento\Framework\Exception\NoSuchEntityException
Retrieve a thesaurus by its ID