Changeset 746
- Timestamp:
- 06/24/07 15:30:24 (1 year ago)
- Files:
-
- trunk/src/main/php/net/stubbles/rdbms/pdo/stubDatabasePDOStatement.php (modified) (4 diffs)
- trunk/src/main/php/net/stubbles/rdbms/stubDatabaseStatement.php (modified) (1 diff)
- trunk/src/test/php/net/stubbles/rdbms/RDBMSTestSuite.php (modified) (1 diff)
- trunk/src/test/php/net/stubbles/rdbms/pdo/stubDatabasePDOStatementTestCase.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/rdbms/pdo/stubDatabasePDOStatement.php
r250 r746 128 128 * the array elements must use keys corresponding to the 129 129 * number of the position or name of the parameter 130 * @return bool true on success, false on failure130 * @return stubDatabaseResult 131 131 * @throws stubDatabaseException 132 132 * @see http://php.net/pdostatement-execute … … 136 136 { 137 137 try { 138 return $this->pdoStatement->execute($values); 138 if (true === $this->pdoStatement->execute($values)) { 139 return $this; 140 } 141 142 throw new stubDatabaseException('Executing the prepared statement failed.'); 139 143 } catch (PDOException $pdoe) { 140 144 throw new stubDatabaseException($pdoe->getMessage(), $pdoe); … … 154 158 public function fetch($fetchMode = null, array $driverOptions = array()) 155 159 { 156 if (null == $fetchMode) {160 if (null === $fetchMode) { 157 161 $fetchMode = PDO::FETCH_BOTH; 158 162 } … … 195 199 * @see http://php.net/pdostatement-fetchAll 196 200 * @see net.stubbles.rdbms.stubDatabaseResult::fetchAll() 197 * @todo fix handling of $fetchMode together with $driverOptions198 201 */ 199 202 public function fetchAll($fetchMode = null, array $driverOptions = array()) 200 203 { 201 204 try { 202 if (null == $fetchMode) {205 if (null === $fetchMode) { 203 206 return $this->pdoStatement->fetchAll(); 204 207 } 205 208 206 return $this->pdoStatement->fetchAll($fetchMode, ((isset($driverOptions['columnIndex']) == false) ? (null) : ($driverOptions['columnIndex']))); 209 if (PDO::FETCH_COLUMN == $fetchMode) { 210 return $this->pdoStatement->fetchAll($fetchMode, ((isset($driverOptions['columnIndex']) == false) ? (0) : ($driverOptions['columnIndex']))); 211 } 212 213 return $this->pdoStatement->fetchAll($fetchMode); 207 214 } catch (PDOException $pdoe) { 208 215 throw new stubDatabaseException($pdoe->getMessage(), $pdoe); trunk/src/main/php/net/stubbles/rdbms/stubDatabaseStatement.php
r256 r746 53 53 * the array elements must use keys corresponding to the 54 54 * number of the position or name of the parameter 55 * @return bool true on success, false on failure55 * @return stubDatabaseResult 56 56 * @throws stubDatabaseException 57 57 */ trunk/src/test/php/net/stubbles/rdbms/RDBMSTestSuite.php
r655 r746 40 40 // pdo 41 41 $this->addTestFile($dir . '/pdo/stubDatabasePDOConnectionTestCase.php'); 42 $this->addTestFile($dir . '/pdo/stubDatabasePDOStatementTestCase.php'); 42 43 43 44 // persistence
