1
0
mirror of synced 2025-01-06 00:57:10 +03:00

fix for php 5.2 compatibility

This commit is contained in:
romanb 2006-11-28 18:20:38 +00:00
parent 94277fcf54
commit b68d060ef5

View File

@ -1,26 +1,26 @@
<?php <?php
/* /*
* $Id$ * $Id$
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* This software consists of voluntary contributions made by many individuals * This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see * and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>. * <http://www.phpdoctrine.com>.
*/ */
/** /**
* Doctrine_Db_Statement * Doctrine_Db_Statement
* *
* @author Konsta Vesterinen <kvesteri@cc.hut.fi> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @package Doctrine * @package Doctrine
@ -29,47 +29,47 @@
* @since 1.0 * @since 1.0
* @version $Revision$ * @version $Revision$
*/ */
class Doctrine_Db_Statement extends PDOStatement { class Doctrine_Db_Statement extends PDOStatement {
protected $dbh; protected $dbh;
protected $querySequence; protected $querySequence;
protected $baseSequence; protected $baseSequence;
protected $executed = false; protected $executed = false;
protected function __construct($dbh) { protected function __construct($dbh) {
$this->dbh = $dbh; $this->dbh = $dbh;
$this->baseSequence = $this->querySequence = $this->dbh->getQuerySequence(); $this->baseSequence = $this->querySequence = $this->dbh->getQuerySequence();
} }
public function getQuerySequence() { public function getQuerySequence() {
return $this->querySequence; return $this->querySequence;
} }
public function getBaseSequence() { public function getBaseSequence() {
return $this->baseSequence; return $this->baseSequence;
} }
public function getQuery() { public function getQuery() {
return $this->queryString; return $this->queryString;
} }
public function isExecuted($executed = null) { public function isExecuted($executed = null) {
if($executed === null) if($executed === null)
return $this->executed; return $this->executed;
$this->executed = (bool) $executed; $this->executed = (bool) $executed;
} }
public function execute(array $params = array()) { public function execute(array $params = null) {
$event = new Doctrine_Db_Event($this, Doctrine_Db_Event::EXECUTE, $this->queryString); $event = new Doctrine_Db_Event($this, Doctrine_Db_Event::EXECUTE, $this->queryString);
$this->dbh->getListener()->onPreExecute($event); $this->dbh->getListener()->onPreExecute($event);
$ret = parent::execute($params); $ret = parent::execute($params);
$this->dbh->getListener()->onExecute($event); $this->dbh->getListener()->onExecute($event);
return $this; return $this;
} }
} }