Stud.IP  5.4
StudipPDOStatement Class Reference
Inheritance diagram for StudipPDOStatement:

Public Member Functions

 __construct ($db, $query, $options)
 
 setStatement (PDOStatement $statement)
 
 bindColumn ($column, &$param)
 
 bindParam ($parameter, &$variable, $data_type=null)
 
 bindValue ($parameter, $value, $data_type=null)
 
 __call ($name, array $arguments)
 
 getIterator ()
 
 execute ($input_parameters=NULL)
 
 fetchGrouped ($fetch_style=PDO::FETCH_ASSOC, $group_func='current')
 
 fetchGroupedPairs ($group_func=null)
 
 fetchPairs ()
 
 fetchFirst ()
 
 fetchOne ()
 

Protected Member Functions

 replaceParam ($matches)
 

Protected Attributes

 $db
 
 $query
 
 $options
 
 $columns
 
 $params
 
 $count
 
 $stmt
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $db,
  $query,
  $options 
)

Initializes a new StudipPDOStatement instance.

Member Function Documentation

◆ __call()

__call (   $name,
array  $arguments 
)

Forwards all unknown methods to the actual statement object.

◆ bindColumn()

bindColumn (   $column,
$param 
)

Arranges to have a particular variable bound to a given column in the result-set from a query. Each call to fetch() or fetchAll() will update all the variables that are bound to columns.

◆ bindParam()

bindParam (   $parameter,
$variable,
  $data_type = null 
)

Binds a PHP variable to a corresponding named or question mark place- holder in the SQL statement that was used to prepare the statement. Unlike bindValue(), the variable is bound as a reference and will only be evaluated at the time that execute() is called.

◆ bindValue()

bindValue (   $parameter,
  $value,
  $data_type = null 
)

Binds a value to a corresponding named or question mark placeholder in the SQL statement that was used to prepare the statement.

◆ execute()

execute (   $input_parameters = NULL)

Executes the prepared statement and returns a PDOStatement object.

◆ fetchFirst()

fetchFirst ( )

Returns sequential array with values from first colum

Returns
array first row result set

◆ fetchGrouped()

fetchGrouped (   $fetch_style = PDO::FETCH_ASSOC,
  $group_func = 'current' 
)

Returns the result set rows as a grouped associative array. The first field of each row is used as the array's keys. optionally apply given callable on each grouped row to aggregate results if no callable is given, 'current' is used, to return the first entry of the grouped row

Parameters
int$fetch_styleEither PDO::FETCH_ASSOC or PDO::FETCH_COLUMN
callable$group_funcfunction to aggregate grouped rows
Returns
array grouped result set

◆ fetchGroupedPairs()

fetchGroupedPairs (   $group_func = null)

Returns the result set rows as a grouped associative array. The first field of each row is used as the array's keys, the other one is grouped use only when selecting 2 columns optionally apply given callable on each grouped row to aggregate results

Parameters
callable$group_funcfunction to aggregate grouped rows
Returns
array grouped result set

◆ fetchOne()

fetchOne ( )

Returns only first row of result set as associative array

Returns
array first row result set

◆ fetchPairs()

fetchPairs ( )

Returns result rows as associative array, first colum as key, second as value. Use only when selecting 2 columns

Returns
array result set

◆ getIterator()

getIterator ( )

Forwards all Iterator methods to the actual statement object.

◆ replaceParam()

replaceParam (   $matches)
protected

Replaces a placeholder with the corresponding parameter value. Throws an exception if there is no corresponding value.

◆ setStatement()

setStatement ( PDOStatement  $statement)

Injects a PDOStatement

Field Documentation

◆ $columns

$columns
protected

◆ $count

$count
protected

◆ $db

$db
protected

◆ $options

$options
protected

◆ $params

$params
protected

◆ $query

$query
protected

◆ $stmt

$stmt
protected

The documentation for this class was generated from the following file: