Run query and returns matches, or null if no matches are found.

@param  String $value
@return Array when matches are found.
488491
protected function _query($value) 
    { 
        /**
         * Check for an adapter being defined. if not, fetch the default adapter.
         */ 
        if($this->_adapter === null) {
            $this->_adapter = Zend_Db_Table_Abstract::getDefaultAdapter();
        }

        /**
         * Build select object
         */ 
        $select = new Zend_Db_Select($this->_adapter);
        $select->from($this->_table)
               ->columns($this->_field)
               ->where($this->_adapter->quoteIdentifier($this->_field).' = ?', $value); 
        if ($this->_exclude !== null) { 
            if (is_array($this->_exclude)) { 
                $select->where($this->_adapter->quoteIdentifier($this->_exclude['field']).' != ?', $this->_exclude['value']); 
            } else { 
                $select->where($this->_exclude); 
            } 
        } 
        $select->limit(1); 
                 
        /**
         * Run query
         */ 
        $result = $this->_adapter->fetchRow($select, array(), Zend_Db::FETCH_ASSOC); 
         
        return $result; 
    }
138789
public static function matches($value, $pattern)
    {
        if (is_array($pattern)) {
            if (!is_array($value) && !$value instanceof \Traversable) {
                return false;
            }

            $keyMatcher = self::key_matcher($pattern);

            foreach ($value as $key => $item) {
                if (! $keyMatcher($key, $item)) return false;
            }

            if (! $keyMatcher()) return false;

            return true;
        }

        return self::matcher($value, $pattern);
    }
285299
protected function query($value)
    {
        $conditions = [$this->field => $value];
        /** @var MapperInterface $mapper */
        $mapper = $this->mapperManager->get($this->getEntity());
        if (!empty($this->exclude)) {
            $field = $this->exclude['field'] ?? '';
            $excludedValue = $this->exclude['value'] ?? '';
            $operator = $this->exclude['operator'] ?? '!=';

            if (!empty($field) && !empty($excludedValue)) {
                $conditions[] = $mapper->quoteIdentifier($field) . $operator . $mapper->quoteValue($excludedValue);
            }
        }
        $result = $mapper->find('all', [
            'conditions' => $conditions
        ]);

        return $result;
    }
62444
public function matches(string $value): bool
    {
        $check = @preg_match($this->pattern, $value);
        if (false === $check) {
            throw new \RuntimeException(sprintf(
                    'Failure while matching "%s", reason: %s.',
                    $this->pattern,
                    $this->messageFor(preg_last_error())
            ));
        }

        return ((1 != $check) ? (false) : (true));
    }
1344641
private function parse($value): array
    {
        if (is_array($value)) {
            if ($value[0] !== $value[1]) {
                return $this->error('PASSWORDS_NOT_EQUAL');
            }

            $value = $value[0];
        }

        if (empty($value) === 0) {
            return [null, []];
        }

        return [Secret::create($value), []];
    }
8807
protected function query($value)
    {
        $filters[$this->getKey()] = $value;
        $result = false;
//         if(!$this->getMapper()->enableFilters($filters))
//             throw new \Exception('Invalid filters used in record validator');
        
        $result = $this->getMapper()->findByFilters($filters);
        return $result;
    }
398883
protected function _splitQueryValue($value)
    {
        $data = explode('=', $value, 2);
        if (1 === count($data)) {
            $data[] = null;
        }
        return $data;
    }
1210640
protected function _getCompoundIdColumnValues($value)
        {
            $filtered = [];

            foreach($this->_getIdColumnName() as $key) {
                $filtered[$key] = isset($value[$key]) ? $value[$key] : null;
            }

            return $filtered;
        }
1131969
public function apply(Value $value): array
    {
        if ($value->isEmpty()) {
            return $this->null();
        }

        try {
            return $this->filtered(new Day($value->value()));
        } catch (\InvalidArgumentException $iae) {
            return $this->error('DATE_INVALID');
        }
    }
862299
protected function query($value)
    {
        $class = $this->entityOptions->getUser();
        /** @var \PServerCore\Entity\UserInterface $user */
        $user = new $class();
        $user->setUsername($value);

        return $this->gameBackendService->isUserNameExists($user);
    }
974119
private function matchValue($value, $pattern)
    {
        // basic check
        if ($value == $pattern) {
            return true;
        }

        // simple check in case of optional param
        if ($pattern == '?') {
            return true;
        }

        // simple match in case pattern is just "*"
        if ($pattern == '*' && $value != '') {
            return true;
        }

        // more complex match in case when wildcard is part of a larger match
        $pattern = str_replace('*', '(.+)', $pattern);

        // regex match
        if (strpos($pattern, '(') !== false || strpos($pattern, '[') !== false || strpos($pattern, '\\') !== false) {
            return preg_match('#^' . $pattern . '$#', $value);
        }

        return false;
    }
490700
public function filter($value) {
        if($value === null)
            return null;

        try {
            $sourceDT = new DateTime($value);
            $targetTZ = new DateTimeZone($this->options["timezone"] ? $this->options["timezone"] : date_default_timezone_get());
            $targetDT = $sourceDT;
            $targetDT->setTimeZone($targetTZ);

            return $targetDT->format($this->options["format"]);
        }
        catch(Exception $e) {
            return false;
        }
    }
979050
public function filter($value)
    {
        $replace = $this->getReplaceCallback();
        $filtered = $value;

        foreach ($this->patterns as $index => $pattern)
        {
            $filtered = preg_replace_callback($pattern, $replace[$index], $filtered);
        }

        return $filtered;
    }
1090320
public function value($value = NULL) {
        if($value == NULL) {
            return false;
        }
        
        $o = explode('.',$value);
        $data = $this->request->data;
        return $data[$o[0]][$o[1]][$o[2]];
    }
500235
public function tags($value)
    {
        foreach ($this->candidates as $categorizer) {
            $result = $categorizer->tags($value);
            if ($result !== null) {
                return $result;
            }
        }

        return [];
    }
1276005
protected function query($value)
    {
        /** @var EntityManagerInterface $objectManager */
        $objectManager = $this->getOption('object_manager');
        /** @var string $targetClass */
        $targetClass = $this->getOption('target_class');

        /** @var \PServerCore\Entity\Repository\User $repo */
        $repo = $objectManager->getRepository($targetClass);

        return $repo->isUserValid4UserName($value);
    }
319739
protected function query($value)
    {
        $query = $this->getEntityManager()->createQueryBuilder();
        $query->select(sprintf('entity.%s', $this->getField()))
                ->from($this->getEntity(), 'entity')
                ->where(sprintf('entity.%s = :field', $this->getField()))
                ->setParameter(':field', $value);

        foreach ($this->getExclude() as $exclude => $value) {
            $query->andWhere(sprintf('entity.%s != :%s', $exclude, $exclude))
                    ->setParameter($exclude, $value);
        }

        foreach ($this->getInclude() as $include => $value) {
            $query->andWhere(sprintf('entity.%s = :%s', $include, $include))
                    ->setParameter($include, $value);
        }

        return $query->getQuery()->execute();
    }