Sql_Controller
in package
SQL.
Tags
Table of Contents
Properties
- $instance : mixed
- The singleton instances.
- $_config : array<string|int, mixed>|null
- $_Core_DataBase : Core_DataBase|null
Methods
- __construct() : mixed
- execute() : mixed
- Выполнение SQL-запроса
- executeByFile() : mixed
- Выполнение SQL-запроса из файла
- executeByString() : mixed
- Выполнение SQL-запроса из строки
- getFieldsIcon() : Admin_Form_Entity
- Get fields icon
- getIndexesIcon() : Admin_Form_Entity
- Get indexes icon
- getTableViewIcon() : Admin_Form_Entity
- Get fields icon
- instance() : object
- Register an existing instance as a singleton.
- sanitizeIdentifiers() : string
- Sanitize MySQL Identifiers
- _executeQuery() : bool
- Выполнение SQL-запроса из строки с подменой ENGINE и CHARSET
Properties
$instance
The singleton instances.
public
static mixed
$instance
= \NULL
$_config
protected
array<string|int, mixed>|null
$_config
= \NULL
$_Core_DataBase
protected
Core_DataBase|null
$_Core_DataBase
= \NULL
Methods
__construct()
public
__construct() : mixed
execute()
Выполнение SQL-запроса
public
execute(string $sql) : mixed
Parameters
- $sql : string
-
SQL-запрос
Tags
Return values
mixed —количество выполненных запросов или NULL
executeByFile()
Выполнение SQL-запроса из файла
public
executeByFile(string $filePath) : mixed
Parameters
- $filePath : string
-
путь к файлу
Return values
mixed —количество выполненных запросов или NULL
executeByFile(CMS_FOLDER . 'sql/myfile.sql');
?>
executeByString()
Выполнение SQL-запроса из строки
public
executeByString(string $sql) : mixed
Parameters
- $sql : string
-
SQL-запрос
Return values
mixed —количество выполненных запросов
Sql_Controller::instance()->executeByString($sql);
?>
getFieldsIcon()
Get fields icon
public
static getFieldsIcon(mixed $tableName[, string $class = 'fa fa-th-list h5-edit-icon azure' ]) : Admin_Form_Entity
Parameters
- $tableName : mixed
- $class : string = 'fa fa-th-list h5-edit-icon azure'
Return values
Admin_Form_EntitygetIndexesIcon()
Get indexes icon
public
static getIndexesIcon(mixed $tableName[, string $class = 'fas fa-key h5-edit-icon success' ]) : Admin_Form_Entity
Parameters
- $tableName : mixed
- $class : string = 'fas fa-key h5-edit-icon success'
Return values
Admin_Form_EntitygetTableViewIcon()
Get fields icon
public
static getTableViewIcon(mixed $tableName[, string $class = 'fa fa-table h5-edit-icon warning' ]) : Admin_Form_Entity
Parameters
- $tableName : mixed
- $class : string = 'fa fa-table h5-edit-icon warning'
Return values
Admin_Form_Entityinstance()
Register an existing instance as a singleton.
public
static instance() : object
Return values
objectsanitizeIdentifiers()
Sanitize MySQL Identifiers
public
static sanitizeIdentifiers(mixed $str) : string
Parameters
- $str : mixed
Return values
string_executeQuery()
Выполнение SQL-запроса из строки с подменой ENGINE и CHARSET
protected
_executeQuery(string $sql) : bool
Parameters
- $sql : string
-
SQL-запрос