public function DB::fetch_all in Anti Spam by CleanTalk 8.4
Same name in this branch
- 8.4 src/lib/Cleantalk/Common/DB.php \Cleantalk\Common\DB::fetch_all()
- 8.4 src/lib/Cleantalk/ApbctDrupal/DB.php \Cleantalk\ApbctDrupal\DB::fetch_all()
Same name and namespace in other branches
- 9.1.x src/lib/Cleantalk/ApbctDrupal/DB.php \Cleantalk\ApbctDrupal\DB::fetch_all()
Fetchs all result from query. May receive raw or prepared query.
Parameters
bool $query:
bool $response_type:
Return value
array|object|null
Overrides DB::fetch_all
File
- src/
lib/ Cleantalk/ ApbctDrupal/ DB.php, line 76
Class
Namespace
Cleantalk\ApbctDrupalCode
public function fetch_all($query = false, $response_type = false) {
$this->db_result = \Drupal::service('database')
->query($query);
$this->result = array();
while ($row = $this->db_result
->fetchAssoc()) {
$this->result[] = $row;
}
return $this->result;
}