class Routines (View source)

Functions for routine management.

Properties

array<int,string> $directions
array<int,string> $sqlDataAccess
array<int,string> $numericOptions

Methods

__construct(DatabaseInterface $dbi)

No description

string
handleRequestCreateOrEdit(UserPrivileges $userPrivileges, string $db)

Handle request to create or edit a routine

array
backupPrivileges(UserPrivileges $userPrivileges)

Backup the privileges

array
create(UserPrivileges $userPrivileges, string $routineQuery, string $createRoutine, array $privilegesBackup)

Create the routine

flushPrivileges(bool $flushPrivileges)

Flush privileges and get message

array
getDataFromRequest()

This function will generate the values that are required to complete the editor form. It is especially necessary to handle the 'Add another parameter', 'Remove last parameter' and 'Change routine type' functionalities when JS is disabled.

array|null
getDataFromName(string $name, string $type, bool $all = true)

This function will generate the values that are required to complete the "Edit routine" form given the name of a routine.

array
getParameterRow(array $routine = [], mixed $index = null, string $class = '')

Creates one row for the parameter table used in the routine editor.

string
getQueryFromRequest()

Composes the query necessary to create a routine from an HTTP request.

array
handleExecuteRoutine(array $routine)

No description

array
getExecuteForm(array $routine)

Creates the HTML code that shows the routine execution dialog.

array
getRow(Routine $routine, string $rowClass = '')

Creates the contents for a row in the list of routines

static array
getDetails(DatabaseInterface $dbi, string $db, string|null $which = null, string $name = '')

returns details about the PROCEDUREs or FUNCTIONs for a specific database or details about a specific routine

static string|null
getFunctionDefinition(DatabaseInterface $dbi, string $db, string $name)

No description

static string|null
getProcedureDefinition(DatabaseInterface $dbi, string $db, string $name)

No description

static array
getFunctionNames(DatabaseInterface $dbi, string $db)

No description

static array
getProcedureNames(DatabaseInterface $dbi, string $db)

No description

Details

__construct(DatabaseInterface $dbi)

No description

Parameters

DatabaseInterface $dbi

string handleRequestCreateOrEdit(UserPrivileges $userPrivileges, string $db)

Handle request to create or edit a routine

Parameters

UserPrivileges $userPrivileges
string $db

Return Value

string

array backupPrivileges(UserPrivileges $userPrivileges)

Backup the privileges

Parameters

UserPrivileges $userPrivileges

Return Value

array

array create(UserPrivileges $userPrivileges, string $routineQuery, string $createRoutine, array $privilegesBackup)

Create the routine

Parameters

UserPrivileges $userPrivileges
string $routineQuery

Query to create routine

string $createRoutine

Query to restore routine

array $privilegesBackup

Privileges backup

Return Value

array

Message flushPrivileges(bool $flushPrivileges)

Flush privileges and get message

Parameters

bool $flushPrivileges

Flush privileges

Return Value

Message

array getDataFromRequest()

This function will generate the values that are required to complete the editor form. It is especially necessary to handle the 'Add another parameter', 'Remove last parameter' and 'Change routine type' functionalities when JS is disabled.

Return Value

array

Data necessary to create the routine editor.

array|null getDataFromName(string $name, string $type, bool $all = true)

This function will generate the values that are required to complete the "Edit routine" form given the name of a routine.

Parameters

string $name

The name of the routine.

string $type

Type of routine (ROUTINE|PROCEDURE)

bool $all

Whether to return all data or just the info about parameters.

Return Value

array|null

Data necessary to create the routine editor.

array getParameterRow(array $routine = [], mixed $index = null, string $class = '')

Creates one row for the parameter table used in the routine editor.

Parameters

array $routine

Data for the routine returned by getDataFromRequest() or getDataFromName()

mixed $index

Either a numeric index of the row being processed or NULL to create a template row for AJAX request

string $class

Class used to hide the direction column, if the row is for a stored function.

Return Value

array

string getQueryFromRequest()

Composes the query necessary to create a routine from an HTTP request.

Return Value

string

The CREATE [ROUTINE | PROCEDURE] query.

array handleExecuteRoutine(array $routine)

No description

Parameters

array $routine

Return Value

array

array getExecuteForm(array $routine)

Creates the HTML code that shows the routine execution dialog.

Parameters

array $routine

Data for the routine returned by getDataFromName()

Return Value

array

array getRow(Routine $routine, string $rowClass = '')

Creates the contents for a row in the list of routines

Parameters

Routine $routine
string $rowClass

Additional class

Return Value

array

static array getDetails(DatabaseInterface $dbi, string $db, string|null $which = null, string $name = '')

returns details about the PROCEDUREs or FUNCTIONs for a specific database or details about a specific routine

Parameters

DatabaseInterface $dbi
string $db

db name

string|null $which

PROCEDURE | FUNCTION or null for both

string $name

name of the routine (to fetch a specific routine)

Return Value

array

static string|null getFunctionDefinition(DatabaseInterface $dbi, string $db, string $name)

No description

Parameters

DatabaseInterface $dbi
string $db
string $name

Return Value

string|null

static string|null getProcedureDefinition(DatabaseInterface $dbi, string $db, string $name)

No description

Parameters

DatabaseInterface $dbi
string $db
string $name

Return Value

string|null

static array getFunctionNames(DatabaseInterface $dbi, string $db)

No description

Parameters

DatabaseInterface $dbi
string $db

Return Value

array

static array getProcedureNames(DatabaseInterface $dbi, string $db)

No description

Parameters

DatabaseInterface $dbi
string $db

Return Value

array