for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Gerard van Helden <[email protected]>
* @copyright Zicht Online <http://zicht.nl>
*/
namespace Zicht\Bundle\UrlBundle\Entity\Repository;
use Doctrine\ORM\EntityRepository;
use Zicht\Bundle\UrlBundle\Aliasing\UrlAliasRepositoryInterface;
use Zicht\Bundle\UrlBundle\Entity\UrlAlias;
* Default repository implementation for url aliases
class UrlAliasRepository extends EntityRepository implements UrlAliasRepositoryInterface
{
* @{inheritDoc}
public function findOneByPublicUrl($publicUrl, $mode = UrlAlias::REWRITE)
$where = ['public_url' => $publicUrl];
if (null !== $mode) {
$where['mode']= $mode;
}
return $this->findOneBy($where, ['id' => 'ASC']);
public function findOneByInternalUrl($internalUrl, $mode = UrlAlias::REWRITE)
$where = ['internal_url' => $internalUrl];
public function findAllByInternalUrl($internalUrl)
return $this->findBy(
['internal_url' => $internalUrl],
['id' => 'ASC']
);