stepnameRepository = $stepnameRepository; } /** * If the given step is valid * * @param \WapplerSystems\BookmarksLikesRatings\Domain\Model\Stepname $stepname * @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException */ protected function isValid($stepname): void { //a stepname object must have a stepconf if (!$stepname->getStepconf() instanceof Stepconf) { $this->addError( LocalizationUtility::translate('error.validator.stepname.stepconf', 'ThRating'), 1382895072 ); } //check if given languagecode exists in website if (!$this->stepnameRepository->checkStepnameLanguage($stepname)) { $this->addError(LocalizationUtility::translate('error.validator.stepname.sysLang', 'ThRating'), 1382895089); } //now check if entry for default language exists $langUid = $stepname->getSysLanguageUid(); if (!empty($langUid)) { $defaultStepname = $this->stepnameRepository->findDefaultStepname($stepname); if (get_class($defaultStepname) !== Stepname::class || $this->validate($defaultStepname)->hasErrors()) { $this->addError( LocalizationUtility::translate('error.validator.stepname.defaultLang', 'ThRating'), 1382895097 ); } } } }