Skip to content

Commit

Permalink
RunQuery public, move IF-statement out of columnCount().
Browse files Browse the repository at this point in the history
  • Loading branch information
gabordemooij committed Feb 25, 2023
1 parent c706a13 commit 184954f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
10 changes: 5 additions & 5 deletions RedBeanPHP/Driver/RPDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ protected function bindParams( $statement, $bindings )
* @return mixed
* @throws SQL
*/
protected function runQuery( $sql, $bindings, $options = array() )
public function runQuery( $sql, $bindings, $options = array() )
{
$this->connect();
if ( $this->loggingEnabled && $this->logger ) {
Expand All @@ -181,12 +181,12 @@ protected function runQuery( $sql, $bindings, $options = array() )
$statement->execute();
$this->queryCounter ++;
$this->affectedRows = $statement->rowCount();
if ( isset( $options['noFetch'] ) && $options['noFetch'] ) {
$this->resultArray = array();
return $statement;
}
if ( $statement->columnCount() ) {
$fetchStyle = ( isset( $options['fetchStyle'] ) ) ? $options['fetchStyle'] : NULL;
if ( isset( $options['noFetch'] ) && $options['noFetch'] ) {
$this->resultArray = array();
return $statement;
}
if ( is_null( $fetchStyle) ) {
$this->resultArray = $statement->fetchAll();
} else {
Expand Down
4 changes: 3 additions & 1 deletion testing/RedUNIT/Base/Fuse.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,10 @@ public function testFactory()
/**
* Make sure that beans of type book_page can be fused with
* models like BookPage (beautified) as well as Book_Page (non-beautified).
*
* @return void
*/
public function testBeutificationOfLinkModel()
public function testBeautificationOfLinkModel()
{
$page = R::dispense( 'page' );
$widget = R::dispense( 'widget' );
Expand Down
4 changes: 2 additions & 2 deletions testing/RedUNIT/Mysql/Writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ public function testSetGetJSON()
*/
public function testFunctionFilters()
{
global $travis;
if ($travis) return;
if (strpos(R::getCell('select version()'), '10.3.9-MariaDB') === FALSE)
return;
R::nuke();
R::bindFunc( 'read', 'location.point', 'asText' );
R::bindFunc( 'write', 'location.point', 'GeomFromText' );
Expand Down

0 comments on commit 184954f

Please sign in to comment.