Attempts to resolve the fetch mode.

@param string $className The class name
@param string $fetchMode The fetch mode
@return integer The fetch mode as defined in ClassMetadata
@throws ORM\MappingException If the fetch mode is not valid
190999
private function getFetchMode($className, $fetchMode)
    {
        $fetchMode = strtoupper($fetchMode);
        if (!defined('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $fetchMode)) {
            throw ORM\MappingException::invalidFetchMode($className, $fetchMode);
        }

        return constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $fetchMode);
    }
762288
protected function getClassIdFromModuleMap($className)
    {
        $moduleControllerMapProvider = $this->getModuleControllerMapProvider();
        $idToNameMap = $moduleControllerMapProvider->getControllerMap();
        $classId = $this->arrayLookup($className, array_flip($idToNameMap));

        return $classId;
    }
820226
public function query($query = '', $params = null, $fetchmode = PDO::FETCH_ASSOC)
    {
        $query = trim($query);
        if (empty($query)) {
            $query = $this->build();
            if (!$params) {
                $params = $this->getBindValues();
            }
        }

        $this->resetAll();
        $this->lastSql = $query;

        $this->execute($query, $params);

        $rawStatement = explode(" ", $query);

        $statement = strtolower(trim($rawStatement[0]));
        if ($statement === 'select' || $statement === 'show') {
            return $this->sQuery->fetchAll($fetchmode);
        } elseif ($statement === 'update' || $statement === 'delete') {
            return $this->sQuery->rowCount();
        } elseif ($statement === 'insert') {
            if ($this->sQuery->rowCount() > 0) {
                return $this->lastInsertId();
            }
        } else {
            return null;
        }

        return null;
    }
349281
public function select($query, array $params = [], $fetchMode = null)
    {
        // Execute query
        $stmt = $this->connection->prepare($query);
        $stmt->execute($params);
        if ($fetchMode !== null) {
            $stmt->setFetchMode($fetchMode);
        }
        return $stmt->fetchAll();
    }
1051593
protected function fetchFirst(...$fetchMode)
	{
		$query = $this->limit(1)->compiler->select();

		return $this->connection->first($query['sql'], $query['params'], ...$fetchMode);
	}
376134
public function fetch($query, $mode)
    {
        $context = $this->getCommandContext();
        $context->mode = $mode;
        $context->query = $query;
        $context->repository = $query->getRepository();

        if ($this->getCommandChain()->run('before.fetch', $context) !== false) {
            $modes = array(
                    AnDomain::FETCH_ROW => AnDatabase::FETCH_ARRAY,
                    AnDomain::FETCH_ROW_LIST => AnDatabase::FETCH_ARRAY_LIST,
                    AnDomain::FETCH_ENTITY => AnDatabase::FETCH_ARRAY,
                    AnDomain::FETCH_ENTITY_SET => AnDatabase::FETCH_ARRAY_LIST,
                    AnDomain::FETCH_ENTITY_LIST => AnDatabase::FETCH_ARRAY_LIST,
                    AnDomain::FETCH_VALUE => AnDatabase::FETCH_FIELD,
                    AnDomain::FETCH_VALUE_LIST => AnDatabase::FETCH_FIELD_LIST,
            );

            $mode = $modes[$mode];

            $context['data'] = $this->_adapter->select(to_str($query), $mode);

            $this->getCommandChain()->run('after.fetch', $context);
        }

        return $context->data;
    }
1357094
private static function collectMapping(string $className, Mapping $objectAnnotation, string $methodName)
    {
        $mapped = $objectAnnotation->getName();

        self::$commandMapping[$className]['routes'][] = [
            'mappedName' => $mapped,
            'methodName' => $methodName,
        ];
    }
237104
public final function resolve(string $className, CacheInterface $cache = null)
   {
       try {
           return $this->resolver->resolve($className, $cache);
       } catch (NotFoundException $e) {
           throw $e;
       } catch (ContainerException $e) {
           throw $e;
       }
   }
811311
protected function _fetch_object($class_name = 'stdClass')
	{
		// No native support for fetching rows as objects
		if (($row = $this->result_id->fetchArray(SQLITE3_ASSOC)) === FALSE)
		{
			return FALSE;
		}
		elseif ($class_name === 'stdClass')
		{
			return (object) $row;
		}

		$class_name = new $class_name();
		foreach (array_keys($row) as $key)
		{
			$class_name->$key = $row[$key];
		}

		return $class_name;
	}
249377
public function paginate($fetchMode = PDO::FETCH_ASSOC) {
        $distinct = $this->distinct ? 'DISTINCT' : '';
        $groupby = '';
        if (!empty($this->group)) {
            $groupby = 'GROUP BY ' . $this->group;
            if (!empty($this->having)) $groupby .= ' ' . $this->having;
        }

        //先获取数量
        $sql = "SELECT $distinct count('*') FROM `$this->table` $this->alias $this->join $this->where $groupby";
        $sql = str_replace('table.',$this->alias.'.',$sql);
        $num = $this->execute($sql, $this->params)->fetchColumn();

        //再获取数据
        $order = !empty($this->order) ? "ORDER BY $this->order" : '';

        $this->fields = $this->fields?$this->fields:'*';
        $sql = "SELECT $distinct $this->fields FROM `$this->table` $this->alias $this->join $this->where $groupby $order $this->limit";
        $sql = str_replace('table.',$this->alias.'.',$sql);

        $result = $this->execute($sql, $this->params)->fetchAll($fetchMode);
        $result = $this->_data($result,true);

        return [$num,$result];
    }
543938
public function setFetchmode($mode)
    {
        if (is_numeric($mode)) {
            $this->fetchMode = (int) $mode;
        } else {
            if (defined($mode)) {
                $this->fetchMode = constant($mode);
            } else {
                throw new BuildException("Invalid PDO fetch mode specified: " . $mode, $this->getLocation());
            }
        }
    }
941369
public function setFetchMode($mode)
    {
        switch ($mode) {
            case Zend_Db::FETCH_NUM:   // seq array
            case Zend_Db::FETCH_ASSOC: // assoc array
            case Zend_Db::FETCH_BOTH:  // seq+assoc array
            case Zend_Db::FETCH_OBJ:   // object
                $this->_fetchMode = $mode;
                break;
            case Zend_Db::FETCH_BOUND:   // bound to PHP variable
                /**
                 * @see Zend_Db_Adapter_Db2_Exception
                 */
                // require_once 'Zend/Db/Adapter/Db2/Exception.php';
                throw new Zend_Db_Adapter_Db2_Exception('FETCH_BOUND is not supported yet');
                break;
            default:
                /**
                 * @see Zend_Db_Adapter_Db2_Exception
                 */
                // require_once 'Zend/Db/Adapter/Db2/Exception.php';
                throw new Zend_Db_Adapter_Db2_Exception("Invalid fetch mode '$mode' specified");
                break;
        }
    }
453131
public function find($condition, $params = NULL, $fields=null, $fetchMode=PDO::FETCH_ASSOC) {
		if (!empty($fields)) $this->driver->field($fields);
		return $this->driver
            ->where($condition, $params)
            ->fetch($fetchMode);
	}
400502
public void fetchMode(String associationPath, FetchMode fetchMode) {
        if (criteria != null) {
            criteria.setFetchMode(associationPath, fetchMode);
        }
    }
895456
public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEXT, $cursorOffset = 0)
    {
        if (! is_resource($this->result)) {
            return false;
        }

        $fetchMode = $fetchMode ?: $this->defaultFetchMode;

        switch ($fetchMode) {
            case FetchMode::COLUMN:
                return $this->fetchColumn();

            case FetchMode::ASSOCIATIVE:
                return sasql_fetch_assoc($this->result);

            case FetchMode::MIXED:
                return sasql_fetch_array($this->result, SASQL_BOTH);

            case FetchMode::CUSTOM_OBJECT:
                $className = $this->defaultFetchClass;
                $ctorArgs  = $this->defaultFetchClassCtorArgs;

                if (func_num_args() >= 2) {
                    $args      = func_get_args();
                    $className = $args[1];
                    $ctorArgs  = $args[2] ?? [];
                }

                $result = sasql_fetch_object($this->result);

                if ($result instanceof stdClass) {
                    $result = $this->castObject($result, $className, $ctorArgs);
                }

                return $result;

            case FetchMode::NUMERIC:
                return sasql_fetch_row($this->result);

            case FetchMode::STANDARD_OBJECT:
                return sasql_fetch_object($this->result);

            default:
                throw new SQLAnywhereException('Fetch mode is not supported: ' . $fetchMode);
        }
    }
1150738
private function fetch($url, $className) {
    $key = sha1($url);
    
    if(! isset($this->cache[$key])) {
      $xml = $this->httpClient->get($url);
      $this->cache[$key] = call_user_func_array(
              array($className, 'createFromXml'), array($xml, $this));
    }
    
    return $this->cache[$key];
  }
975738
static public function findByQuery($sqlQuery, array $params, $fetchMode = \PDO::FETCH_OBJ)
    {
        $model = new static;
        if($model->table) {
            $sqlQuery = str_replace(':table', $model->table, $sqlQuery);
        }

        $result = $model->execute($sqlQuery);
        return $result;
    }