Fetch data from database. Lazy load.

@return array
198198
protected function loadRelated(): array
    {
        $innerKey = $this->parent->getField($this->key(Record::INNER_KEY));
        if (!empty($innerKey)) {
            return $this->createSelector($innerKey)->fetchData();
        }

        return [];
    }
597709
public function getData() : ?array
     {
        $rtn = $this->data['data'];

        $rtn = json_decode($rtn, true);

        if ($rtn === false) {
            $rtn = null;
        }

        return $rtn;
     }
1353791
public function fetch()
    {
        if ($row = mysql_fetch_array($this->query)) {
            return $row;
        } else if ($this->size() > 0) {
            mysql_data_seek($this->query, 0);
            return false;
        } else {
            return false;
        }
    }
318343
public function get()
	{
		// Get the columns
		$columns = $this->select();

		// Start building the query
		$select = $columns;
		if ($this->use_subquery())
		{
			$select = array();
			foreach ($columns as $c)
			{
				$select[] = $c[0];
			}
		}

		$query = call_fuel_func_array('DB::select', $select);

		// Set from view/table
		$query->from(array($this->_table(), $this->alias));

		// Build the query further
		$tmp     = $this->build_query($query, $columns);
		$query   = $tmp['query'];
		$models  = $tmp['models'];

		// Make models hierarchical
		foreach ($models as $name => $values)
		{
			if (strpos($name, '.'))
			{
				unset($models[$name]);
				$rels = explode('.', $name);
				$ref =& $models[array_shift($rels)];
				foreach ($rels as $rel)
				{
					empty($ref['models']) and $ref['models'] = array();
					empty($ref['models'][$rel]) and $ref['models'][$rel] = array();
					$ref =& $ref['models'][$rel];
				}
				$ref = $values;
			}
		}

		$rows = $query->execute($this->connection)->as_array();
		$result = array();
		$model = $this->model;
		$select = $this->select();
		$primary_key = $model::primary_key();
		foreach ($rows as $id => $row)
		{
			$this->hydrate($row, $models, $result, $model, $select, $primary_key);
			unset($rows[$id]);
		}

		// It's all built, now lets execute and start hydration
		return $result;
	}
1213369
protected function load()
    {
        // Select related IDs from aggregation table
        $query = [
            $this->thisField => $this->getParentEntity()->id
        ];

        $relatedObjects = Entity::getInstance()->getDatabase()->find($this->intermediateCollection, $query, [$this->refField => 1]);
        $relatedIds = [];
        foreach ($relatedObjects as $rObject) {
            $relatedIds[] = $rObject[$this->refField];
        }

        // Find all related entities using $relatedIds
        $callable = [
            $this->getEntity(),
            'find'
        ];

        return call_user_func_array($callable, [['id' => ['$in' => $relatedIds]]]);
    }
764446
public function fetchAll() {
    if (!empty($this->delayed_results)) {
      $result = $this->delayed_results;
      $this->delayed_results = array();
      return $result;
    } else {
      return false;
    }
  }
1179354
protected function getData() {
        if ($this->data === null) {
            $stmt = $this->db->get(
                $this->table,
                $this->where,
                $this->options + [Db::OPTION_FETCH_MODE => $this->getFetchArgs()]
            );

            $data = $stmt->fetchAll(...(array)$this->getFetchArgs());

            if (is_callable($this->rowCallback)) {
                array_walk($data, function (&$row) {
                    $row = call_user_func($this->rowCallback, $row);
                });
            }

            $this->data = $data;
        }

        return $this->data;
    }
891925
public function getData() : array
    {
        $data = [];

        if ($this->getRequest()->getMethod() == Request::METHOD_POST) {
            $data = $_POST ?: [];
        }

        return $data;
    }
1162399
protected function _getData()
    {
        $data = $this->getRepository()->fetch($this->getQuery(), AnDomain::FETCH_ENTITY_LIST);

        return $data;
    }
238748
public function fetch() {
		if( !$this->fetchLastStatement ) {
			$this->startFetching();
		}
		$row = $this->fetchLastStatement->fetch(\PDO::FETCH_ASSOC);
		if( !$row ) {
			// Last return false, we return null, same effect
			return null;
		}
		if( !$this->fetchIsObject ) {
			return $row;
		}
		$class = $this->class;
		return $class::load($row, true, $this->usingCache);
	}
863182
public function fetchAll()
    {
        $query = sprintf('SELECT * FROM `%s`', $this->table);
        $rows = array();

        foreach ($this->pdo->query($query) as $index => $row) {
            $value =& $row[ConstProviderInterface::CONFIG_PARAM_VALUE];

            if ($this->serializer->isSerialized($value)) {
                $value = $this->serializer->unserialize($value);
            }

            array_push($rows, $row);
        }

        return $rows;
    }
739509
public function load()
    {
        $data = [];
        $routes = $this->getRoutes();
        foreach($routes as $route) {
            $parsedRoute = $this->parseRoute($route);
            $routeData = $this->requestService($route, $parsedRoute);

            if ($routeData !== null) {
                // When the routeData contains more entry. (if it's a numeric array)
                if (array_values($routeData) === $routeData) {
                    $data = array_merge($data, $routeData);
                }
                else {
                    $data[] = $routeData;
                }
            }
        }
        $this->returnData($data);
    }
678994
public function loadAssoc()
	{
		// Initialise variables
		$return = null;

		// Execute the query
		if (!$this->execute())
		{
			return null;
		}

		// Get the first row from the result set as an associative array
		if ($row = $this->fetchAssoc())
		{
			$return = $row;
		}

		// Free up system resources and return
		$this->freeResult();

		return $return;
	}
855363
public function getAll()
    {
        $sql = "SELECT * FROM `$this->_table`";
        $this->__init_database();

        if ($stmt = $this->db->prepare($sql)) return $this;

        $this->result = $stmt->fetchAll(MySQL::FETCH_OBJ);

        return $this;
    }
148656
public function get(): array
    {
        /**
         * @var $queryObject   \Pecee\Pixie\QueryBuilder\QueryObject
         * @var $executionTime float
         * @var $start         float
         * @var $result        array
         */

        $queryObject = $this->getQuery();
        $this->connection->setLastQuery($queryObject);

        $this->fireEvents(EventHandler::EVENT_BEFORE_SELECT, $queryObject);

        $executionTime = 0;
        $startTime = microtime(true);

        if ($this->pdoStatement === null) {

            [$this->pdoStatement, $executionTime] = $this->statement(
                $queryObject->getSql(),
                $queryObject->getBindings()
            );
        }

        $result = \call_user_func_array([$this->pdoStatement, 'fetchAll'], $this->fetchParameters);
        $this->pdoStatement = null;

        $executionTime += microtime(true) - $startTime;

        $this->fireEvents(EventHandler::EVENT_AFTER_SELECT, $queryObject, [
            'execution_time' => $executionTime,
        ]);

        return $result;
    }
209291
public function fetchAll()
    {
        if ($this->usePaginator === true) {
            return $this->initPaginator($this->tableGateway->getSql()->select());
        }
        $this->result = $this->tableGateway->select();

        return $this->result;
    }
60568
private function _getCurrentData()
    {
        $cls = $this->_cls;
        if (!$this->_data) {
            $this->_data = $cls::executePrepared($this->_builder, $this->_vals);
        }
        return $this->_data->fetch(\PDO::FETCH_ASSOC);
    }