Fetch data from database. Lazy load. Method require a bit of love.

@return array
971042
protected function loadRelated(): array
    {
        $innerKey = $this->parent->getField($this->key(Record::INNER_KEY));
        if (empty($innerKey)) {
            return [];
        }

        //Work with pre-build query
        $query = $this->createQuery($innerKey);

        //Use custom node to parse data
        $node = new PivotedRootNode(
            $this->schema[Record::RELATION_COLUMNS],
            $this->schema[Record::PIVOT_COLUMNS],
            $this->schema[Record::OUTER_KEY],
            $this->schema[Record::THOUGHT_INNER_KEY],
            $this->schema[Record::THOUGHT_OUTER_KEY]
        );

        $iterator = $query->getIterator();
        foreach ($iterator as $row) {
            //Time to parse some data
            $node->parseRow(0, $row);
        }

        //Memory free
        $iterator->close();

        return $node->getResult();
    }
166137
private function load()
    {
        if (\count($this->attributes)) {
            return;
        }

        $sessionBag         = $this->session->getBag($this->getSessionBagKey());
        $databaseSessionBag = $this->session->getBag($this->getDatabaseSessionBagKey());

        $this->attributes = \array_merge(
            (array) $sessionBag->get($this->getScope()),
            (array) $databaseSessionBag->get($this->getScope())
        );
    }
453901
public function get(): array
    {
        $dataFetcher = new DataFetcher($this->httpClient);

        $this->data = $dataFetcher->get($this->query, $this->pluck);

        return $this->data;
    }
759908
public function loadIndexedList()
    {
        if ($this->stmt === null) {
            return null;
        }

        $indexedList = array();
        while ($row = $this->stmt->fetch(\PDO::FETCH_NUM)) {
            $indexedList[] = $row;
        }
        return $indexedList;
    }
37970
protected function pullGet(): array {
		if (!is_array($this->getVars)) {
			$this->getVars = $this->request->getQueryParams();
		}
		
		return $this->getVars;
	}
682474
public function __load()
    {
        if (! file_exists($file = $this->getDatabaseFileName())) {
            return collect();
        }

        return collect(json_decode(file_get_contents($file), true));
    }
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]]]);
    }
395208
protected function fetchData()
    {
        if (null === $this->_dataReader) {
            $qb = clone $this->qs->getQueryBuilder();
            $this->_dataReader = new DataReader($this->connection->query($qb->toSQL()));
        }
        $rows = [];
        $count = 0;
        while ($count++ < $this->batchSize && ($row = $this->_dataReader->read())) {
            $rows[] = $row;
        }

        return $this->asArray ? $rows : $this->qs->createModels($rows);
    }
62417
public static function getDatas() {
		$method = \strtolower ( $_SERVER ['REQUEST_METHOD'] );
		switch ($method) {
			case 'post' :
				if (self::getContentType () == 'application/x-www-form-urlencoded') {
					return $_POST;
				}
				break;
			case 'get' :
				return $_GET;
			default :
				return self::getInput ();
		}
		return self::getInput ();
	}
231121
public function fetchAll(): array
    {
        $st = $this->run();
        try {
            return $st->fetchAll(\PDO::FETCH_ASSOC);
        } finally {
            $st->close();
        }
    }
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;
    }
225471
public function loadResult()
	{
		$this->connect();

		$ret = null;

		// Execute the query and get the result set cursor.
		if (!($cursor = $this->execute()))
		{
			return null;
		}

		// Get the first row from the result set as an array.
		$row = $this->fetchArray($cursor);

		if ($row)
		{
			$ret = $row[0];
		}

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

		return $ret;
	}
234497
protected function loadData()
    {
        $this->loaded = true;

        $innerKey = $this->key(Record::INNER_KEY);
        if (empty($this->parent->getField($innerKey))) {
            //Unable to load
            return;
        }

        $selector = $this->orm->selector($this->getClass());
        $decorator = new AliasDecorator($selector, 'where', $selector->getAlias());
        $decorator->where($this->whereStatement());

        $this->data = $selector->fetchData();

        if (!empty($this->data[0])) {
            //Use first result
            $this->data = $this->data[0];
        }
    }
472384
protected function _fetch() {
		if (!$this->_resource instanceof PDOStatement) {
			$this->close();
			return false;
		}
		try {
			if ($result = $this->_resource->fetch(PDO::FETCH_NUM)) {
				return [$this->_iterator++, $result];
			}
		} catch (PDOException $e) {
			$this->close();
			return false;
		}
		return null;
	}
499102
function fetch() {

        $this->execute();

        list( $index, $row ) = each( $this->rows );

        return $row;

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

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

        return $data;
    }
189086
public function getData()
    {
        if (null === $this->data) {
            $this->data = $this->loadData();
        }

        return $this->data;
    }