"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Database/Statement/PDOStatement.php" between
cakephp-4.0.1.tar.gz and cakephp-4.0.2.tar.gz

About: CakePHP is a rapid development framework for PHP applications. Source code.

PDOStatement.php  (cakephp-4.0.1):PDOStatement.php  (cakephp-4.0.2)
skipping to change at line 99 skipping to change at line 99
* *
* ### Example: * ### Example:
* *
* ``` * ```
* $statement = $connection->prepare('SELECT id, title from articles'); * $statement = $connection->prepare('SELECT id, title from articles');
* $statement->execute(); * $statement->execute();
* print_r($statement->fetch('assoc')); // will show ['id' => 1, 'title' => 'a title'] * print_r($statement->fetch('assoc')); // will show ['id' => 1, 'title' => 'a title']
* ``` * ```
* *
* @param string|int $type 'num' for positional columns, assoc for named col umns * @param string|int $type 'num' for positional columns, assoc for named col umns
* @return array|false Result array containing columns and values or false i f no results * @return mixed Result array containing columns and values or false if no r esults
* are left * are left
*/ */
public function fetch($type = parent::FETCH_TYPE_NUM) public function fetch($type = parent::FETCH_TYPE_NUM)
{ {
if ($type === static::FETCH_TYPE_NUM) { if ($type === static::FETCH_TYPE_NUM) {
return $this->_statement->fetch(PDO::FETCH_NUM); return $this->_statement->fetch(PDO::FETCH_NUM);
} }
if ($type === static::FETCH_TYPE_ASSOC) { if ($type === static::FETCH_TYPE_ASSOC) {
return $this->_statement->fetch(PDO::FETCH_ASSOC); return $this->_statement->fetch(PDO::FETCH_ASSOC);
} }
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)