From ff112209610b5c2abc968f29f2d1265e1527f994 Mon Sep 17 00:00:00 2001 From: romanb Date: Thu, 1 May 2008 09:50:23 +0000 Subject: [PATCH] minor refactorings & cleanups. --- lib/Doctrine/Mapper.php | 12 +----------- lib/Doctrine/Pager.php | 1 + lib/Doctrine/Sequence/Db2.php | 2 +- lib/Doctrine/Sequence/Firebird.php | 4 ++-- lib/Doctrine/Sequence/Mssql.php | 2 +- lib/Doctrine/Sequence/Mysql.php | 2 +- lib/Doctrine/Sequence/Oracle.php | 2 +- lib/Doctrine/Sequence/Pgsql.php | 2 +- lib/Doctrine/Sequence/Sqlite.php | 6 ++---- 9 files changed, 11 insertions(+), 22 deletions(-) diff --git a/lib/Doctrine/Mapper.php b/lib/Doctrine/Mapper.php index 0b912970e..282373063 100644 --- a/lib/Doctrine/Mapper.php +++ b/lib/Doctrine/Mapper.php @@ -354,7 +354,6 @@ class Doctrine_Mapper return $record; } - $idHash = $this->_conn->unitOfWork->getIdentifierHash($id); if ($record = $this->_conn->unitOfWork->tryGetByIdHash($idHash, @@ -374,6 +373,7 @@ class Doctrine_Mapper /** * @param $id database row id + * @todo Looks broken. Figure out an implementation and decide whether its needed. */ final public function getProxy($id = null) { @@ -544,16 +544,6 @@ class Doctrine_Mapper { return $this->_domainClassName; } - - /** - * returns a string representation of this object - * - * @return string - */ - /*public function __toString() - { - return Doctrine_Lib::getTableAsString($this); - }*/ /** * findBy diff --git a/lib/Doctrine/Pager.php b/lib/Doctrine/Pager.php index ffa5190ff..3d948abc4 100644 --- a/lib/Doctrine/Pager.php +++ b/lib/Doctrine/Pager.php @@ -30,6 +30,7 @@ * @version $Revision$ * @link www.phpdoctrine.org * @since 0.9 + * @todo Move the Pager into a separate package ("Doctrine Utilities"? or even a "Doctrine Pager" package?) */ class Doctrine_Pager { diff --git a/lib/Doctrine/Sequence/Db2.php b/lib/Doctrine/Sequence/Db2.php index 4af66c82a..3df1686cd 100644 --- a/lib/Doctrine/Sequence/Db2.php +++ b/lib/Doctrine/Sequence/Db2.php @@ -18,7 +18,7 @@ * and is licensed under the LGPL. For more information, see * . */ -Doctrine::autoload('Doctrine_Sequence'); + /** * Doctrine_Sequence_Db2 * diff --git a/lib/Doctrine/Sequence/Firebird.php b/lib/Doctrine/Sequence/Firebird.php index 90e4f7772..a0ff03041 100644 --- a/lib/Doctrine/Sequence/Firebird.php +++ b/lib/Doctrine/Sequence/Firebird.php @@ -18,7 +18,7 @@ * and is licensed under the LGPL. For more information, see * . */ -Doctrine::autoload('Doctrine_Sequence'); + /** * Doctrine_Sequence_Firebird * @@ -33,7 +33,7 @@ Doctrine::autoload('Doctrine_Sequence'); class Doctrine_Sequence_Firebird extends Doctrine_Sequence { /** - * Returns the next free id of a sequence + * Returns the next free id of a sequence. * * @param string $seqName name of the sequence * @param bool when true missing sequences are automatic created diff --git a/lib/Doctrine/Sequence/Mssql.php b/lib/Doctrine/Sequence/Mssql.php index 957829fdb..0b38f5685 100644 --- a/lib/Doctrine/Sequence/Mssql.php +++ b/lib/Doctrine/Sequence/Mssql.php @@ -18,7 +18,7 @@ * and is licensed under the LGPL. For more information, see * . */ -Doctrine::autoload('Doctrine_Sequence'); + /** * Doctrine_Sequence_Mssql * diff --git a/lib/Doctrine/Sequence/Mysql.php b/lib/Doctrine/Sequence/Mysql.php index 1903255ee..ccca7e819 100644 --- a/lib/Doctrine/Sequence/Mysql.php +++ b/lib/Doctrine/Sequence/Mysql.php @@ -18,7 +18,7 @@ * and is licensed under the LGPL. For more information, see * . */ -Doctrine::autoload('Doctrine_Sequence'); + /** * Doctrine_Sequence_Mysql * diff --git a/lib/Doctrine/Sequence/Oracle.php b/lib/Doctrine/Sequence/Oracle.php index 9fef95469..e842de1ca 100644 --- a/lib/Doctrine/Sequence/Oracle.php +++ b/lib/Doctrine/Sequence/Oracle.php @@ -18,7 +18,7 @@ * and is licensed under the LGPL. For more information, see * . */ -Doctrine::autoload('Doctrine_Sequence'); + /** * Doctrine_Sequence_Oracle * diff --git a/lib/Doctrine/Sequence/Pgsql.php b/lib/Doctrine/Sequence/Pgsql.php index 8c66fe815..111b7d879 100644 --- a/lib/Doctrine/Sequence/Pgsql.php +++ b/lib/Doctrine/Sequence/Pgsql.php @@ -18,7 +18,7 @@ * and is licensed under the LGPL. For more information, see * . */ -Doctrine::autoload('Doctrine_Sequence'); + /** * Doctrine_Sequence_Pgsql * diff --git a/lib/Doctrine/Sequence/Sqlite.php b/lib/Doctrine/Sequence/Sqlite.php index 72e2a1b01..23d7e1440 100644 --- a/lib/Doctrine/Sequence/Sqlite.php +++ b/lib/Doctrine/Sequence/Sqlite.php @@ -33,7 +33,7 @@ class Doctrine_Sequence_Sqlite extends Doctrine_Sequence { /** - * Returns the next free id of a sequence + * Returns the next free id of a sequence. * * @param string $seqName name of the sequence * @param bool $onDemand when true missing sequences are automatic created @@ -48,9 +48,7 @@ class Doctrine_Sequence_Sqlite extends Doctrine_Sequence $query = 'INSERT INTO ' . $sequenceName . ' (' . $seqcolName . ') VALUES (NULL)'; try { - - $num = $this->conn->exec($query); - + $this->conn->exec($query); } catch (Doctrine_Connection_Exception $e) { if ($onDemand && $e->getPortableCode() == Doctrine::ERR_NOSUCHTABLE) { try {