Skip to content

Commit

Permalink
Remove deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Salamek authored Jul 24, 2017
1 parent b557715 commit c11b4b7
Showing 1 changed file with 2 additions and 52 deletions.
54 changes: 2 additions & 52 deletions src/Dravencms/Model/Partner/Repository/PartnerRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
}
}

0 comments on commit c11b4b7

Please sign in to comment.