module/Application/src/Application/Repository/State.php
/**
     * find user by email address - used primarily for oAuth2
     * @param type $email
     * @param array $params
     * @return Application\Entity\User
     */
find user by email address - used primarily for oAuth2
@param type $email
@param array $params
@return Application\Entity\User
find user by email address - used primarily for oAuth2 @param type $email @param array $params @return Application \ Entity \ User
public function findByCompatibility($compatibility, array $params=array()) {
        $queryBuilder = $this->_em->createQueryBuilder();
        $queryBuilder
            ->select('s')
            ->from('Application\Entity\State', 's')
            ->orderBy('s.name', 'ASC');
        if (is_int($compatibility)) {
            $queryBuilder->andWhere('BIT_AND(s.compatibility, '.$compatibility.')='.$compatibility);
        } elseif(is_array($compatibility)) {
            $compatibilityStr = array();
            foreach ($compatibility as $comp) {
                $compatibilityStr[] = '(BIT_AND(s.compatibility, '.$comp.')='.$comp.')';
            }
            $queryBuilder->andWhere(implode(' OR ', $compatibilityStr));
        }
        $query  = $queryBuilder->getQuery();
        return $query->getResult();
    }
public function findByCompatibility ( $ compatibility , array $ params = array ( ) ) { $ queryBuilder = $ this -> _em -> createQueryBuilder ( ) ; $ queryBuilder -> select ( 's' ) -> from ( 'Application\Entity\State' , 's' ) -> orderBy ( 's.name' , 'ASC' ) ; if ( is_int ( $ compatibility ) ) { $ queryBuilder -> andWhere ( 'BIT_AND(s.compatibility, ' . $ compatibility . ')=' . $ compatibility ) ; } elseif ( is_array ( $ compatibility ) ) { $ compatibilityStr = array ( ) ; foreach ( $ compatibility as $ comp ) { $ compatibilityStr [ ] = '(BIT_AND(s.compatibility, ' . $ comp . ')=' . $ comp . ')' ; } $ queryBuilder -> andWhere ( implode ( ' OR ' , $ compatibilityStr ) ) ; } $ query = $ queryBuilder -> getQuery ( ) ; return $ query -> getResult ( ) ; }
find user by email address - used primarily for oAuth2
 @param type $email
 @param array $params
 @return Application\Entity\User
find user by email address - used primarily for oAuth2 @param type $email @param array $params @return Application \ Entity \ User