This method fetches all the records in the database table and returns them in an array
557998
public static function getAll()
    {
        try {
            $tableName = self::getTableName();
            $conn = self::getConnection();

            $stmt = $conn->query('SELECT * FROM '.$tableName);

            return $stmt->fetchAll(PDO::FETCH_ASSOC);
        }
        catch(PDOException $pe) {
            return $pe->getMessage();
        }
        catch(Exception $e) {
            return $e->getMessage();
        }
    }
416785
public function all()
    {
        $table = trim(self::$table);
        if (!empty($table)) {
            $query = /** @lang text */
                "SELECT * FROM {$table}";


            if(!empty($this->groupby)){
                $query.=' GROUP BY '.$this->groupby;
            }

            if (!empty($this->order)) {
                $query .= $this->order;
            }


            //execute the query and return the data or error message
              return  $this->fetch($query);


        } else {
            static::$response["status"] = "error";
            static::$response["response"] = "Table name cannot be empty";
            static::$response["code"] = 5000;
            return static::terminate(static::$response);
        }
    }
1369366
protected function getRecords()
    {
        $records = [];

        foreach ($this->query->get() as $row) {
            $record = [];
            foreach ($this->columns as $name => $handler) {
                $record[$name] = $handler($row);
            }
            $records[] = $record;
        }

        return $records;
    }
488881
public function get_all()
    {
        $this->trigger('before_get');

        if ($this->soft_delete && $this->_temporary_with_deleted !== TRUE)
        {
            $this->_database->where($this->soft_delete_key, (bool)$this->_temporary_only_deleted);
        }

        $result = $this->_database->get($this->_table)
                           ->{$this->_return_type(1)}();
        $this->_temporary_return_type = $this->return_type;

        foreach ($result as $key => &$row)
        {
            $row = $this->trigger('after_get', $row, ($key == count($result) - 1));
        }

        $this->_with = array();
        return $result;
    }
18621
protected function getData() {

        $sql = ['SELECT document FROM '.$this->collection->name];

        if ($this->criteria) {

            $sql[] = 'WHERE document_criteria("'.$this->criteria.'", document)';
        }

        if ($this->sort) {

            $orders = [];

            foreach ($this->sort as $field => $direction) {
                $orders[] = 'document_key("'.$field.'", document) '.($direction==-1 ? 'DESC':'ASC');
            }

            $sql[] = 'ORDER BY '.\implode(',', $orders);
        }

        if ($this->limit) {
            $sql[] = 'LIMIT '.$this->limit;

            if ($this->skip) { $sql[] = 'OFFSET '.$this->skip; }
        }

        $sql = implode(' ', $sql);

        $stmt      = $this->collection->database->connection->query($sql);
        $result    = $stmt->fetchAll( \PDO::FETCH_ASSOC);
        $documents = [];

        if (!$this->projection) {

            foreach ($result as &$doc) {
                $documents[] = \json_decode($doc['document'], true);
            }

        } else {

            $exclude = [];
            $include = [];

            foreach ($this->projection as $key => $value) {

                if ($value) {
                    $include[$key] = 1;
                } else {
                    $exclude[$key] = 1;
                }
            }

            foreach ($result as &$doc) {

                $item = \json_decode($doc['document'], true);
                $id   = $item['_id'];

                if ($exclude) {
                    $item = \array_diff_key($item, $exclude);
                }

                if ($include) {
                    $item = array_key_intersect($item, $include);
                }

                if (!isset($exclude['_id'])) {
                    $item['_id'] = $id;
                }

                $documents[] = $item;
            }
        }

        return $documents;
    }
1237991
public function get(): array
    {
        $pdoStatement = $this->provideStatement();
        $pdoStatement = $this->execute($pdoStatement);
        return $pdoStatement->fetchAll(\PDO::FETCH_OBJ);
    }
579755
public function load()
    {
        $data = [];

        $settings = $this->database->select('SELECT * FROM '.$this->table);

        foreach ($settings as $setting) {
            $id = $setting->id;
            $value = $setting->value;

            $decoded = json_decode($value, 1, 512);
            if (is_array($decoded)) {
                $value = $decoded;
            }

            Arr::set($data, $id, $value);
        }

        return $data;
    }
365812
public function fetchArray()
	{
		if( isset( $this->rows[$this->cursor] ) )
		{
			$row = $this->rows[$this->cursor];
			return $row->getPairs();
		}
		else return FALSE;
	}
308931
public function get(): array
    {
        try {
            $query = $this->apply($this->database->getTablePrefixer());
            $compiled = $this->database->getGrammar()->compileSelect($query);
            return $this->database->select($compiled->getSQL(), $compiled->getBindings());
        } catch (\Throwable $exception) {
            return $this->handleException($exception);
        }
    }
582629
@Override
	public List<RecordContext> getAllData () throws DatabaseException {
    	SqlPreparedStatementWrapper psGetAllData = null;
    	try {
        	psGetAllData = DbSQL.getSingleton().getPreparedStatement("context.ps.alldata");
			List<RecordContext> result = new ArrayList<>();
			try (ResultSet rs = psGetAllData.getPs().executeQuery()) {
				while (rs.next()) {
					result.add(new RecordContext(rs.getLong(DATAID), rs.getInt(CONTEXTID), rs.getInt(TYPE), rs.getString(DATA)));
				}
			}
			
			return result;
		} catch (SQLException e) {
			throw new DatabaseException(e);
		} finally {
			DbSQL.getSingleton().releasePreparedStatement(psGetAllData);
		}
    }
1031572
public static function all()
    {
        global $wpdb;

        // Get the table name
        $table = static::get_table();

        // Get the items
        $results = $wpdb->get_results("SELECT * FROM `{$table}`");

        foreach ($results as $index => $result) {
            $results[$index] = static::create((array) $result);
        }

        return $results;
    }
1173971
public function get()
    {
        $rows = [];

        foreach ($this->db as $key => $value) {
            $rows[] = (object) [
                'key'   => $key,
                'value' => is_string($value) ? $value : print_r($value, true),
            ];
        }

        return $rows;
    }
1170060
protected function fetchData()
    {
        if ($this->_iterator === null) {
            if (empty($this->query->orderBy)) {
                // setting cursor batch size may setup implicit limit on the query with 'sort'
                // @see https://jira.mongodb.org/browse/PHP-457
                $this->query->addOptions(['batchSize' => $this->batchSize]);
            }
            $cursor = $this->query->buildCursor($this->db);
            $token = 'fetch cursor id = ' . $cursor->getId();
            Yii::info($token, __METHOD__);

            if ($cursor instanceof \Iterator) {
                $this->_iterator = $cursor;
            } else {
                $this->_iterator = new \IteratorIterator($cursor);
            }

            $this->_iterator->rewind();
        }

        $rows = [];
        $count = 0;

        while ($count++ < $this->batchSize) {
            $row = $this->_iterator->current();
            if ($row === null) {
                break;
            }
            $this->_iterator->next();
            //var_dump($row);
            $rows[] = $row;
        }
        return $this->query->populate($rows);
    }
316542
public function fetchAll() {
		if ($this->selection) {
			/** @var ActiveRow $entity */
			foreach ($this->selection as $entity) {
				$this->createEntity($entity);
			}
		}

		return $this->rows;
	}
932578
public static function all()
    {
        global $wpdb;

        $dbResults = $wpdb->get_results('SELECT * FROM ' . static::getTableName());
        $result = [];
        $model = get_called_class();
        foreach ($dbResults as $dbResult) {
            $modelObject = new $model();
            foreach (self::$columns as $column) {
                $modelObject->$column = $dbResult->$column;
            }
            $result[] = $modelObject;
        }

        return $result;
    }
750826
@Override
	public List<RecordParam> getAll () throws DatabaseException {
    	try {
			List<RecordParam> result = new ArrayList<>();
			try (ResultSet rs = psGetAll.executeQuery()) {
				while (rs.next()) {
					result.add(new RecordParam(rs.getLong(PARAMID), rs.getString(SITE), rs.getString(TYPE),  
							rs.getString(NAME), rs.getInt(USED), rs.getString(FLAGS), rs.getString(VALUES)));
				}
			}
			
			return result;
		} catch (SQLException e) {
			throw new DatabaseException(e);
		}
    }
615179
function fetch_all($result_type = SQLITE_BOTH) {
		$retn = array();
		while($item = $this->fetch_array()) {
			$retn[] = $item;
		}
		return $retn;
	}