|
| bindColumn ($column, &$param, $type=null) |
|
| bindValue ($parameter, $value, $type=null) |
|
| closeCursor () |
|
| columnCount () |
|
| errorCode () |
|
| errorInfo () |
|
| _execute (array $params=null) |
|
| fetch ($style=null, $cursor=null, $offset=null) |
|
| getIterator () |
|
| fetchAll ($style=null, $col=null) |
|
| fetchColumn ($col=0) |
|
| fetchObject ($class='stdClass', array $config=array()) |
|
| getAttribute ($key) |
|
| getColumnMeta ($column) |
|
| nextRowset () |
|
| rowCount () |
|
| setAttribute ($key, $val) |
|
| setFetchMode ($mode) |
|
| __construct ($adapter, $sql) |
|
| bindColumn ($column, &$param, $type=null) |
|
| bindParam ($parameter, &$variable, $type=null, $length=null, $options=null) |
|
| bindValue ($parameter, $value, $type=null) |
|
| execute (array $params=null) |
|
| fetchAll ($style=null, $col=null) |
|
| fetchColumn ($col=0) |
|
| fetchObject ($class='stdClass', array $config=array()) |
|
| getAttribute ($key) |
|
| setAttribute ($key, $val) |
|
| setFetchMode ($mode) |
|
| _fetchBound ($row) |
|
| getAdapter () |
|
| getDriverStatement () |
|
Definition at line 40 of file Pdo.php.
◆ _bindParam()
_bindParam |
( |
|
$parameter, |
|
|
& |
$variable, |
|
|
|
$type = null , |
|
|
|
$length = null , |
|
|
|
$options = null |
|
) |
| |
|
protected |
Binds a parameter to the specified variable name.
- Parameters
-
mixed | $parameter | Name the parameter, either integer or string. |
mixed | $variable | Reference to PHP variable containing the value. |
mixed | $type | OPTIONAL Datatype of SQL parameter. |
mixed | $length | OPTIONAL Length of SQL parameter. |
mixed | $options | OPTIONAL Other options. |
- Returns
- bool
- Exceptions
-
Definition at line 100 of file Pdo.php.
103 if (
$type ===
null) {
105 $type = PDO::PARAM_BOOL;
107 $type = PDO::PARAM_NULL;
109 $type = PDO::PARAM_INT;
111 $type = PDO::PARAM_STR;
115 }
catch (PDOException $e) {
116 #require_once 'Zend/Db/Statement/Exception.php'; elseif(isset( $params[ 'redirect_parent']))
◆ _execute()
_execute |
( |
array |
$params = null | ) |
|
Executes a prepared statement.
- Parameters
-
array | $params | OPTIONAL Values to bind to parameter placeholders. |
- Returns
- bool
- Exceptions
-
Definition at line 224 of file Pdo.php.
228 return $this->_stmt->execute(
$params);
230 return $this->_stmt->execute();
232 }
catch (PDOException $e) {
233 #require_once 'Zend/Db/Statement/Exception.php'; 234 $message = sprintf(
'%s, query was: %s', $e->getMessage(), $this->_stmt->queryString);
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
◆ _prepare()
Prepare a string SQL statement and create a statement object.
- Parameters
-
- Returns
- void
- Exceptions
-
Definition at line 55 of file Pdo.php.
58 $this->_stmt = $this->_adapter->getConnection()->prepare($sql);
59 }
catch (PDOException $e) {
60 #require_once 'Zend/Db/Statement/Exception.php';
◆ bindColumn()
bindColumn |
( |
|
$column, |
|
|
& |
$param, |
|
|
|
$type = null |
|
) |
| |
Bind a column of the statement result set to a PHP variable.
- Parameters
-
string | $column | Name the column in the result set, either by position or by name. |
mixed | $param | Reference to the PHP variable containing the value. |
mixed | $type | OPTIONAL |
- Returns
- bool
- Exceptions
-
Implements Zend_Db_Statement_Interface.
Definition at line 75 of file Pdo.php.
79 return $this->_stmt->bindColumn($column, $param);
81 return $this->_stmt->bindColumn($column, $param,
$type);
83 }
catch (PDOException $e) {
84 #require_once 'Zend/Db/Statement/Exception.php';
◆ bindValue()
bindValue |
( |
|
$parameter, |
|
|
|
$value, |
|
|
|
$type = null |
|
) |
| |
Binds a value to a parameter.
- Parameters
-
mixed | $parameter | Name the parameter, either integer or string. |
mixed | $value | Scalar value to bind to the parameter. |
mixed | $type | OPTIONAL Datatype of the parameter. |
- Returns
- bool
- Exceptions
-
Implements Zend_Db_Statement_Interface.
Definition at line 130 of file Pdo.php.
132 if (is_string($parameter) && $parameter[0] !=
':') {
133 $parameter =
":$parameter";
139 if (
$type ===
null) {
140 return $this->_stmt->bindValue($parameter,
$value);
142 return $this->_stmt->bindValue($parameter,
$value,
$type);
144 }
catch (PDOException $e) {
145 #require_once 'Zend/Db/Statement/Exception.php';
_bindParam($parameter, &$variable, $type=null, $length=null, $options=null)
◆ closeCursor()
Closes the cursor, allowing the statement to be executed again.
- Returns
- bool
- Exceptions
-
Implements Zend_Db_Statement_Interface.
Definition at line 156 of file Pdo.php.
159 return $this->_stmt->closeCursor();
160 }
catch (PDOException $e) {
161 #require_once 'Zend/Db/Statement/Exception.php';
◆ columnCount()
Returns the number of columns in the result set. Returns null if the statement has no result set metadata.
- Returns
- int The number of columns.
- Exceptions
-
Implements Zend_Db_Statement_Interface.
Definition at line 173 of file Pdo.php.
176 return $this->_stmt->columnCount();
177 }
catch (PDOException $e) {
178 #require_once 'Zend/Db/Statement/Exception.php';
◆ errorCode()
Retrieves the error code, if any, associated with the last operation on the statement handle.
- Returns
- string error code.
- Exceptions
-
Implements Zend_Db_Statement_Interface.
Definition at line 190 of file Pdo.php.
193 return $this->_stmt->errorCode();
194 }
catch (PDOException $e) {
195 #require_once 'Zend/Db/Statement/Exception.php';
◆ errorInfo()
Retrieves an array of error information, if any, associated with the last operation on the statement handle.
- Returns
- array
- Exceptions
-
Implements Zend_Db_Statement_Interface.
Definition at line 207 of file Pdo.php.
210 return $this->_stmt->errorInfo();
211 }
catch (PDOException $e) {
212 #require_once 'Zend/Db/Statement/Exception.php';
◆ fetch()
fetch |
( |
|
$style = null , |
|
|
|
$cursor = null , |
|
|
|
$offset = null |
|
) |
| |
Fetches a row from the result set.
- Parameters
-
int | $style | OPTIONAL Fetch mode for this fetch operation. |
int | $cursor | OPTIONAL Absolute, relative, or other. |
int | $offset | OPTIONAL Number for absolute or relative cursors. |
- Returns
- mixed Array, object, or scalar depending on fetch mode.
- Exceptions
-
Implements Zend_Db_Statement_Interface.
Definition at line 248 of file Pdo.php.
250 if ($style ===
null) {
254 return $this->_stmt->fetch($style, $cursor, $offset);
255 }
catch (PDOException $e) {
256 #require_once 'Zend/Db/Statement/Exception.php';
◆ fetchAll()
fetchAll |
( |
|
$style = null , |
|
|
|
$col = null |
|
) |
| |
Returns an array containing all of the result set rows.
- Parameters
-
int | $style | OPTIONAL Fetch mode. |
int | $col | OPTIONAL Column number, if fetch mode is by column. |
- Returns
- array Collection of rows, each in a format by the fetch mode.
- Exceptions
-
Implements Zend_Db_Statement_Interface.
Definition at line 279 of file Pdo.php.
281 if ($style ===
null) {
285 if ($style == PDO::FETCH_COLUMN) {
289 return $this->_stmt->fetchAll($style, $col);
291 return $this->_stmt->fetchAll($style);
293 }
catch (PDOException $e) {
294 #require_once 'Zend/Db/Statement/Exception.php';
◆ fetchColumn()
Returns a single column from the next row of a result set.
- Parameters
-
int | $col | OPTIONAL Position of the column to fetch. |
- Returns
- string
- Exceptions
-
Implements Zend_Db_Statement_Interface.
Definition at line 306 of file Pdo.php.
309 return $this->_stmt->fetchColumn($col);
310 }
catch (PDOException $e) {
311 #require_once 'Zend/Db/Statement/Exception.php';
◆ fetchObject()
fetchObject |
( |
|
$class = 'stdClass' , |
|
|
array |
$config = array() |
|
) |
| |
Fetches the next row and returns it as an object.
- Parameters
-
string | $class | OPTIONAL Name of the class to create. |
array | $config | OPTIONAL Constructor arguments for the class. |
- Returns
- mixed One object instance of the specified class.
- Exceptions
-
Implements Zend_Db_Statement_Interface.
Definition at line 324 of file Pdo.php.
328 }
catch (PDOException $e) {
329 #require_once 'Zend/Db/Statement/Exception.php';
$_option $_optionId $class
◆ getAttribute()
Retrieve a statement attribute.
- Parameters
-
integer | $key | Attribute name. |
- Returns
- mixed Attribute value.
- Exceptions
-
Implements Zend_Db_Statement_Interface.
Definition at line 341 of file Pdo.php.
344 return $this->_stmt->getAttribute($key);
345 }
catch (PDOException $e) {
346 #require_once 'Zend/Db/Statement/Exception.php';
◆ getColumnMeta()
Returns metadata for a column in a result set.
- Parameters
-
- Returns
- mixed
- Exceptions
-
Definition at line 358 of file Pdo.php.
361 return $this->_stmt->getColumnMeta($column);
362 }
catch (PDOException $e) {
363 #require_once 'Zend/Db/Statement/Exception.php';
◆ getIterator()
Required by IteratorAggregate interface
- Returns
- IteratorIterator
Definition at line 266 of file Pdo.php.
268 return new IteratorIterator($this->_stmt);
◆ nextRowset()
Retrieves the next rowset (result set) for a SQL statement that has multiple result sets. An example is a stored procedure that returns the results of multiple queries.
- Returns
- bool
- Exceptions
-
Implements Zend_Db_Statement_Interface.
Definition at line 376 of file Pdo.php.
379 return $this->_stmt->nextRowset();
380 }
catch (PDOException $e) {
381 #require_once 'Zend/Db/Statement/Exception.php';
◆ rowCount()
Returns the number of rows affected by the execution of the last INSERT, DELETE, or UPDATE statement executed by this statement object.
- Returns
- int The number of rows affected.
- Exceptions
-
Implements Zend_Db_Statement_Interface.
Definition at line 394 of file Pdo.php.
397 return $this->_stmt->rowCount();
398 }
catch (PDOException $e) {
399 #require_once 'Zend/Db/Statement/Exception.php';
◆ setAttribute()
setAttribute |
( |
|
$key, |
|
|
|
$val |
|
) |
| |
Set a statement attribute.
- Parameters
-
string | $key | Attribute name. |
mixed | $val | Attribute value. |
- Returns
- bool
- Exceptions
-
Implements Zend_Db_Statement_Interface.
Definition at line 412 of file Pdo.php.
415 return $this->_stmt->setAttribute($key, $val);
416 }
catch (PDOException $e) {
417 #require_once 'Zend/Db/Statement/Exception.php';
◆ setFetchMode()
Set the default fetch mode for this statement.
- Parameters
-
- Returns
- bool
- Exceptions
-
Implements Zend_Db_Statement_Interface.
Definition at line 429 of file Pdo.php.
431 $this->_fetchMode =
$mode;
433 return $this->_stmt->setFetchMode(
$mode);
434 }
catch (PDOException $e) {
435 #require_once 'Zend/Db/Statement/Exception.php';
if($exist=($block->getProductCollection() && $block->getProductCollection() ->getSize())) $mode
◆ $_fetchMode
$_fetchMode = PDO::FETCH_ASSOC |
|
protected |
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php