public function findByEncryptedId($id, $field = 'id') 
	{
	    $hashids = $this->getServiceLocator()->get('neobazaar.service.hashid');
	    $id = $hashids->decrypt($id);
	    $id = is_array($id) ? reset($id) : $id;
	    
        $options = array(); 
        $qb = $this->_em->createQueryBuilder();
        $qb->select(array('a'));
        $qb->from($this->getEntityName(), 'a');
        $qb->where($qb->expr()->eq('a.' . $field, ':value'));
        $qb->setParameter('value', $id);
        $result = $qb->getQuery()->getResult();
        
        return reset($result);
	}
public function findByEncryptedId($id, $field = 'id') 
	{
	    $hashids = $this->getServiceLocator()->get('neobazaar.service.hashid');
	    $id = $hashids->decrypt($id);
	    $id = is_array($id) ? reset($id) : $id;
	    
        $options = array(); 
        $qb = $this->_em->createQueryBuilder();
        $qb->select(array('a'));
        $qb->from($this->getEntityName(), 'a');
        $qb->where($qb->expr()->eq('a.' . $field, ':value'));
        $qb->setParameter('value', $id);
        $result = $qb->getQuery()->getResult();
        
        return reset($result);
	}
public function findByEncryptedId ( $ id , $ field = 'id' ) { $ hashids = $ this -> getServiceLocator ( ) -> get ( 'neobazaar.service.hashid' ) ; $ id = $ hashids -> decrypt ( $ id ) ; $ id = is_array ( $ id ) ? reset ( $ id ) : $ id ; $ options = array ( ) ; $ qb = $ this -> _em -> createQueryBuilder ( ) ; $ qb -> select ( array ( 'a' ) ) ; $ qb -> from ( $ this -> getEntityName ( ) , 'a' ) ; $ qb -> where ( $ qb -> expr ( ) -> eq ( 'a.' . $ field , ':value' ) ) ; $ qb -> setParameter ( 'value' , $ id ) ; $ result = $ qb -> getQuery ( ) -> getResult ( ) ; return reset ( $ result ) ; }
Get an entity using the encrypted ID

@param string $id
@param string $field
@return unknown
Get an entity using the encrypted ID