ResetNames
extends ComplexQuery
in package
Reset names so slugs combined to a correct absolute path.
This class is not yet used.
Table of Contents
Constants
- CACHE_OPTION_NAME = 'mw_complex_query'
Properties
- $cache : mixed
- $isProcedurable : mixed
- $wpdb : mixed
Methods
- __construct() : mixed
- C'tor.
- _isProcedurable() : mixed
- Installs a procedure and checks if it can be used.
- fallback() : mixed
- We do not need a fallback.
- getCache() : mixed
- Get cache.
- getDbh() : string
- Getter.
- getPluginConstantPrefix() : string
- Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
- getResult() : mixed
- Get the result from the three different result types: singleQuery, procedure or fallback.
- getWpdb() : wpdb
- Getter.
- hasProcedure() : bool
- Checks if a given procedure is available for the current user.
- install() : mixed
- Start an installer. Use this function in your procedure() method.
- installProcedure() : mixed
- We do not need a procedure.
- isMysqli() : bool
- Checks if the database handle is mysqli or not.
- isProcedurable() : bool
- Checks if procedures are allowed. This function uses a cache (30 days).
- isSingleQueriableWithUserDefinedVars() : bool
- Checks if a single query is allowed to use @vars. For example MariaDB does not resolve @vars in a single query when they are not declared before.
- procedure() : mixed
- We do not need a procedure.
- singleQuery() : array<string|int, mixed>
- Single query.
- getProcedureResults() : array<string|int, mixed>
- Call a "CALL proc" SQL and parse the results.
Constants
CACHE_OPTION_NAME
public
mixed
CACHE_OPTION_NAME
= 'mw_complex_query'
Properties
$cache
private
mixed
$cache
$isProcedurable
private
mixed
$isProcedurable
$wpdb
private
mixed
$wpdb
Methods
__construct()
C'tor.
public
__construct(wpdb $wpdb) : mixed
Parameters
- $wpdb : wpdb
_isProcedurable()
Installs a procedure and checks if it can be used.
public
final _isProcedurable() : mixed
fallback()
We do not need a fallback.
public
fallback() : mixed
getCache()
Get cache.
public
getCache() : mixed
getDbh()
Getter.
public
getDbh() : string
Return values
stringgetPluginConstantPrefix()
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
public
getPluginConstantPrefix() : string
Tags
Return values
stringgetResult()
Get the result from the three different result types: singleQuery, procedure or fallback.
public
getResult() : mixed
getWpdb()
Getter.
public
getWpdb() : wpdb
Return values
wpdbhasProcedure()
Checks if a given procedure is available for the current user.
public
hasProcedure(string $procedure) : bool
Parameters
- $procedure : string
Return values
boolinstall()
Start an installer. Use this function in your procedure() method.
public
final install(callable $callable) : mixed
Parameters
- $callable : callable
-
The callable to install the procedure for example
installProcedure()
We do not need a procedure.
public
installProcedure() : mixed
isMysqli()
Checks if the database handle is mysqli or not.
public
isMysqli() : bool
Return values
boolisProcedurable()
Checks if procedures are allowed. This function uses a cache (30 days).
public
isProcedurable() : bool
Tags
Return values
boolisSingleQueriableWithUserDefinedVars()
Checks if a single query is allowed to use @vars. For example MariaDB does not resolve @vars in a single query when they are not declared before.
public
isSingleQueriableWithUserDefinedVars() : bool
This method uses a cache (30 days).
Return values
boolprocedure()
We do not need a procedure.
public
procedure() : mixed
singleQuery()
Single query.
public
singleQuery() : array<string|int, mixed>
Return values
array<string|int, mixed>getProcedureResults()
Call a "CALL proc" SQL and parse the results.
protected
final getProcedureResults(string $sql[, bool $returnTrue = false ]) : array<string|int, mixed>
Parameters
- $sql : string
-
The SQL string to execute
- $returnTrue : bool = false
-
When the CALL is successfully and has no results then return true instead of an empty array
Return values
array<string|int, mixed> —or false when an error occur