src/Sulu/Bundle/SecurityBundle/Entity/SecurityTypeRepository.php
public function findSecurityTypeById($id)
    {
        try {
            $qb = $this->createQueryBuilder('securityType')
                ->where('securityType.id=:securityTypeId');

            $query = $qb->getQuery();
            $query->setParameter('securityTypeId', $id);

            return $query->getSingleResult();
        } catch (NoResultException $ex) {
            return;
        }
    }
public function findSecurityTypeById($id)
    {
        try {
            $qb = $this->createQueryBuilder('securityType')
                ->where('securityType.id=:securityTypeId');

            $query = $qb->getQuery();
            $query->setParameter('securityTypeId', $id);

            return $query->getSingleResult();
        } catch (NoResultException $ex) {
            return;
        }
    }
public function findSecurityTypeById ( $ id ) { try { $ qb = $ this -> createQueryBuilder ( 'securityType' ) -> where ( 'securityType.id=:securityTypeId' ) ; $ query = $ qb -> getQuery ( ) ; $ query -> setParameter ( 'securityTypeId' , $ id ) ; return $ query -> getSingleResult ( ) ; } catch ( NoResultException $ ex ) { return ; } }
Searches for a role with a specific id.

@param $id

@return RoleInterface
Searches for a role with a specific id .