Builder::get()
Select all the rows that match with the query.
Return
(TECEventsCustom_TablesV1ModelsModel[])
Source
File: src/Events/Custom_Tables/V1/Models/Builder.php
public function get() {
global $wpdb;
$this->operation = 'SELECT *';
// If the query is invalid, don't return a single result.
if ( $this->invalid ) {
return [];
}
$SQL = $this->get_sql();
$this->queries[] = $SQL;
$results = [];
if ( $this->execute_queries ) {
$results = $wpdb->get_results(
$SQL,
ARRAY_A
);
}
if ( ARRAY_A === $this->output_format ) {
return $results;
}
if ( ARRAY_N === $this->output_format ) {
return array_map( 'array_values', $results );
}
return $this->create_collection( $results );
}
Changelog
| Version | Description |
|---|---|
| 6.0.0 | Introduced. |