class DB in Anti Spam by CleanTalk 8.4
Same name in this branch
- 8.4 src/lib/Cleantalk/Common/DB.php \Cleantalk\Common\DB
- 8.4 src/lib/Cleantalk/ApbctDrupal/DB.php \Cleantalk\ApbctDrupal\DB
Same name and namespace in other branches
- 9.1.x src/lib/Cleantalk/ApbctDrupal/DB.php \Cleantalk\ApbctDrupal\DB
Hierarchy
Expanded class hierarchy of DB
2 files declare their use of DB
- BootSubscriber.php in src/
EventSubscriber/ BootSubscriber.php - CleantalkFuncs.php in src/
CleantalkFuncs.php
File
- src/
lib/ Cleantalk/ ApbctDrupal/ DB.php, line 5
Namespace
Cleantalk\ApbctDrupalView source
class DB extends \Cleantalk\Common\DB {
/**
* Alternative constructor.
* Initilize Database object and write it to property.
* Set tables prefix.
*/
protected function init() {
$this->prefix = \Drupal::service('database')
->tablePrefix();
}
/**
* Set $this->query string for next uses
*
* @param $query
* @return $this
*/
public function set_query($query) {
$this->query = $query;
return $this;
}
/**
* Safely replace place holders
*
* @param string $query
* @param array $vars
*
* @return $this
*/
public function prepare($query, $vars = array()) {
}
/**
* Run any raw request
*
* @param $query
*
* @return bool|int Raw result
*/
public function execute($query) {
$this->db_result = \Drupal::service('database')
->query($query);
return $this->db_result;
}
/**
* Fetchs first column from query.
* May receive raw or prepared query.
*
* @param bool $query
* @param bool $response_type
*
* @return array|object|void|null
*/
public function fetch($query = false, $response_type = false) {
$this->result = \Drupal::service('database')
->query($query)
->fetchAssoc();
return $this->result;
}
/**
* Fetchs all result from query.
* May receive raw or prepared query.
*
* @param bool $query
* @param bool $response_type
*
* @return array|object|null
*/
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;
}
public function get_last_error() {
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DB:: |
private static | property | ||
DB:: |
public | property | ||
DB:: |
public | property | ||
DB:: |
public | function |
Run any raw request Overrides DB:: |
|
DB:: |
public | function |
Fetchs first column from query.
May receive raw or prepared query. Overrides DB:: |
|
DB:: |
public | function |
Fetchs all result from query.
May receive raw or prepared query. Overrides DB:: |
|
DB:: |
public static | function | ||
DB:: |
public | function |
Overrides DB:: |
|
DB:: |
protected | function |
Alternative constructor.
Initilize Database object and write it to property.
Set tables prefix. Overrides DB:: |
|
DB:: |
public | function |
Safely replace place holders Overrides DB:: |
|
DB:: |
public | function |
Set $this->query string for next uses Overrides DB:: |
|
DB:: |
public | function | ||
DB:: |
public | function | ||
DB:: |
public | function |