39 lines
792 B
PHP
39 lines
792 B
PHP
<?php
|
|
|
|
namespace KupShop\ContentBundle\Repository;
|
|
|
|
use KupShop\ContentBundle\Entity\Page;
|
|
|
|
/**
|
|
* PageRepository.
|
|
*
|
|
* This class was generated by the Doctrine ORM. Add your own custom
|
|
* repository methods below.
|
|
*/
|
|
class PageRepository extends \Doctrine\ORM\EntityRepository
|
|
{
|
|
/**
|
|
* @param int|null $id
|
|
* @param string|null $label
|
|
* @param string|null $name
|
|
*
|
|
* @return Page
|
|
*/
|
|
public function findByParams($id = null, $label = null, $name = null)
|
|
{
|
|
if (isset($name)) {
|
|
return $this->findOneByName($name);
|
|
}
|
|
|
|
if (is_numeric($id)) {
|
|
return $this->findOneById($id);
|
|
}
|
|
|
|
if (isset($label)) {
|
|
return $this->findOneByLabel($label);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|