diff --git a/src/Dravencms/Model/Partner/Repository/PartnerRepository.php b/src/Dravencms/Model/Partner/Repository/PartnerRepository.php index 9a00c7f..5ba1b53 100644 --- a/src/Dravencms/Model/Partner/Repository/PartnerRepository.php +++ b/src/Dravencms/Model/Partner/Repository/PartnerRepository.php @@ -15,10 +15,8 @@ use Salamek\Cms\ICmsComponentRepository; use Salamek\Cms\Models\ILocale; -class PartnerRepository implements ICmsComponentRepository +class PartnerRepository { - use TLocalizedRepository; - /** @var \Kdyby\Doctrine\EntityRepository */ private $partnerRepository; @@ -145,52 +143,4 @@ public function getOneByActiveAndParameters($isActive = true, array $parameters $parameters['isActive'] = $isActive; return $this->partnerRepository->findOneBy($parameters); } - - /** - * @param string $componentAction - * @return ICmsActionOption[] - */ - public function getActionOptions($componentAction) - { - switch ($componentAction) - { - case 'Main': - $return = []; - /** @var Partner $partner */ - foreach ($this->partnerRepository->findBy(['isActive' => true]) AS $partner) { - $return[] = new CmsActionOption($partner->getName(), ['id' => $partner->getId()]); - } - break; - - case 'Overview': - case 'Bar': - return null; - break; - - default: - return false; - break; - } - - - return $return; - } - - /** - * @param string $componentAction - * @param array $parameters - * @param ILocale $locale - * @return null|CmsActionOption - */ - public function getActionOption($componentAction, array $parameters, ILocale $locale) - { - $found = $this->findTranslatedOneBy($this->partnerRepository, $locale, $parameters + ['isActive' => true]); - - if ($found) - { - return new CmsActionOption(($found->getLead() ? $found->getLead() . ' ' : '') . $found->getName(), $parameters); - } - - return null; - } -} \ No newline at end of file +}