Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe SqlsrvStatement
+ Graphe d'héritage de SqlsrvStatement:

Fonctions membres publiques

 __construct ($connection, string $query)
 
 prepareParameterKeyMapping ($sql)
 
 bindParam ($parameter, &$variable, string $dataType=ParameterType::STRING, ?int $length=null, ?array $driverOptions=null)
 
 closeCursor ()
 
 errorCode ()
 
 errorInfo ()
 
 execute (?array $parameters=null)
 
 fetch (?int $fetchStyle=null, int $cursorOrientation=FetchOrientation::NEXT, int $cursorOffset=0)
 
 fetchColumn ($columnIndex=0)
 
 rowCount ()
 
 setFetchMode (int $fetchMode,... $args)
 

Attributs protégés

 $connection
 
 $defaultFetchStyle = FetchMode::MIXED
 
 $defaultObjectClass = \stdClass::class
 
 $query
 
 $statement
 
 $typesKeyMapping
 
 $parameterKeyMapping
 
 $parameterTypeMapping
 

Fonctions membres privées

 bindValue ($parameter, $variable, $dataType=ParameterType::STRING)
 
 prepare ()
 

Attributs privés

 $fetchMap
 
 $result = false
 
 $bindedValues = []
 

Description détaillée

SQL Server Database Statement.

This class is modeled on

Depuis
2.0.0

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $connection,
string  $query 
)

Constructor.

Paramètres
resource$connectionThe database connection resource
string$queryThe query this statement will process
Depuis
2.0.0
Exceptions
PrepareStatementFailureException

Références SqlsrvStatement\$connection, ParameterType\BOOLEAN, ParameterType\INTEGER, ParameterType\LARGE_OBJECT, ParameterType\NULL, SqlsrvStatement\prepareParameterKeyMapping(), et ParameterType\STRING.

Documentation des fonctions membres

◆ bindParam()

bindParam (   $parameter,
$variable,
string  $dataType = ParameterType::STRING,
?int  $length = null,
?array  $driverOptions = null 
)

Binds a parameter to the specified variable name.

Paramètres
string | integer$parameterParameter identifier. For a prepared statement using named placeholders, this will be a parameter name of the form :name. For a prepared statement using question mark placeholders, this will be the 1-indexed position of the parameter.
mixed$variableName of the PHP variable to bind to the SQL statement parameter.
string$dataTypeConstant corresponding to a SQL datatype, this should be the processed type from the QueryInterface.
integer$lengthThe length of the variable. Usually required for OUTPUT parameters.
array$driverOptionsOptional driver options to be used.
Renvoie
boolean
Depuis
2.0.0

Implémente StatementInterface.

Références null.

◆ bindValue()

bindValue (   $parameter,
  $variable,
  $dataType = ParameterType::STRING 
)
private

Binds a value to the specified variable.

Paramètres
string | integer$parameterParameter identifier. For a prepared statement using named placeholders, this will be a parameter name of the form :name. For a prepared statement using question mark placeholders, this will be the 1-indexed position of the parameter.
mixed$variableName of the PHP variable to bind to the SQL statement parameter.
string$dataTypeConstant corresponding to a SQL datatype, this should be the processed type from the QueryInterface.
Renvoie
void
Depuis
2.0.0

Référencé par SqlsrvStatement\execute().

◆ closeCursor()

closeCursor ( )

Closes the cursor, enabling the statement to be executed again.

Renvoie
void
Depuis
2.0.0

Implémente StatementInterface.

◆ errorCode()

errorCode ( )

Fetches the SQLSTATE associated with the last operation on the statement handle.

Renvoie
string
Depuis
2.0.0

Implémente StatementInterface.

◆ errorInfo()

errorInfo ( )

Fetches extended error information associated with the last operation on the statement handle.

Renvoie
array
Depuis
2.0.0

Implémente StatementInterface.

Référencé par SqlsrvStatement\execute(), et SqlsrvStatement\prepare().

◆ execute()

execute ( ?array  $parameters = null)

Executes a prepared statement

Paramètres
array | null$parametersAn array of values with as many elements as there are bound parameters in the SQL statement being executed.
Renvoie
boolean
Depuis
2.0.0

Implémente StatementInterface.

Références $key, $parameters, $val, SqlsrvStatement\bindValue(), SqlsrvStatement\errorInfo(), null, et SqlsrvStatement\prepare().

◆ fetch()

fetch ( ?int  $fetchStyle = null,
int  $cursorOrientation = FetchOrientation::NEXT,
int  $cursorOffset = 0 
)

Fetches the next row from a result set

Paramètres
integer | null$fetchStyleControls how the next row will be returned to the caller. This value must be one of the FetchMode constants, defaulting to value of FetchMode::MIXED.
integer$cursorOrientationFor a StatementInterface object representing a scrollable cursor, this value determines which row will be returned to the caller. This value must be one of the FetchOrientation constants, defaulting to FetchOrientation::NEXT.
integer$cursorOffsetFor a StatementInterface object representing a scrollable cursor for which the cursorOrientation parameter is set to FetchOrientation::ABS, this value specifies the absolute number of the row in the result set that shall be fetched. For a StatementInterface object representing a scrollable cursor for which the cursorOrientation parameter is set to FetchOrientation::REL, this value specifies the row to fetch relative to the cursor position before fetch() was called.
Renvoie
mixed The return value of this function on success depends on the fetch type. In all cases, boolean false is returned on failure.
Depuis
2.0.0

Implémente StatementInterface.

Références SqlsrvStatement\$defaultFetchStyle, FetchMode\COLUMN, FetchMode\CUSTOM_OBJECT, SqlsrvStatement\fetchColumn(), et FetchMode\STANDARD_OBJECT.

Référencé par SqlsrvStatement\fetchColumn().

◆ fetchColumn()

fetchColumn (   $columnIndex = 0)

Returns a single column from the next row of a result set

Paramètres
integer$columnIndex0-indexed number of the column you wish to retrieve from the row. If no value is supplied, the first column is retrieved.
Renvoie
mixed Returns a single column from the next row of a result set or boolean false if there are no more rows.
Depuis
2.0.0

Références SqlsrvStatement\fetch(), et null.

Référencé par SqlsrvStatement\fetch().

◆ prepare()

prepare ( )
private

Prepares the SQL Server statement resource for execution

Renvoie
resource
Depuis
2.0.0

Références $key, $options, $params, SqlsrvStatement\$statement, $value, SqlsrvStatement\errorInfo(), et ParameterType\LARGE_OBJECT.

Référencé par SqlsrvStatement\execute().

◆ prepareParameterKeyMapping()

prepareParameterKeyMapping (   $sql)

Replace named parameters with numbered parameters

Paramètres
string$sqlThe SQL statement to prepare.
Renvoie
string The processed SQL statement.
Depuis
2.0.0

Références $i, $n, et $sql.

Référencé par SqlsrvStatement\__construct().

◆ rowCount()

rowCount ( )

Returns the number of rows affected by the last SQL statement.

Renvoie
integer
Depuis
2.0.0

Implémente StatementInterface.

◆ setFetchMode()

setFetchMode ( int  $fetchMode,
  $args 
)

Sets the fetch mode to use while iterating this statement.

Paramètres
integer$fetchModeThe fetch mode, must be one of the FetchMode constants.
mixed...$args Optional mode-specific arguments.
Renvoie
void
Depuis
2.0.0

Implémente StatementInterface.

Documentation des champs

◆ $bindedValues

$bindedValues = []
private

◆ $connection

$connection
protected

Référencé par SqlsrvStatement\__construct().

◆ $defaultFetchStyle

$defaultFetchStyle = FetchMode::MIXED
protected

Référencé par SqlsrvStatement\fetch().

◆ $defaultObjectClass

$defaultObjectClass = \stdClass::class
protected

◆ $fetchMap

$fetchMap
private
Valeur initiale :
= [
FetchMode::MIXED => SQLSRV_FETCH_BOTH

◆ $parameterKeyMapping

$parameterKeyMapping
protected

◆ $parameterTypeMapping

$parameterTypeMapping
protected

◆ $query

$query
protected

◆ $result

$result = false
private

◆ $statement

$statement
protected

Référencé par SqlsrvStatement\prepare().

◆ $typesKeyMapping

$typesKeyMapping
protected

La documentation de cette classe a été générée à partir du fichier suivant :