/**
  * @param int $idTranslation
  *
  * @throws \Spryker\Zed\Glossary\Business\Exception\MissingTranslationException
  *
  * @return \Orm\Zed\Glossary\Persistence\SpyGlossaryTranslation
  */
 protected function getTranslationEntityById($idTranslation)
 {
     $translation = $this->glossaryQueryContainer->queryTranslations()->findPk($idTranslation);
     if (!$translation) {
         throw new MissingTranslationException(sprintf('Could not find a translation with id %s', $idTranslation));
     }
     return $translation;
 }
Beispiel #2
0
 /**
  * @param string $keyFragment
  *
  * @return array
  */
 public function getKeySuggestions($keyFragment)
 {
     return $this->queryContainer->queryActiveKeysByName('%' . $keyFragment . '%')->select([SpyGlossaryKeyTableMap::COL_KEY])->find()->toArray();
 }
 /**
  * @param int $fkGlossaryKey
  *
  * @return \Orm\Zed\Glossary\Persistence\SpyGlossaryKey
  */
 protected function getGlossaryKey($fkGlossaryKey)
 {
     return $this->glossaryQueryContainer->queryKeys()->findOneByIdGlossaryKey($fkGlossaryKey);
 }