From cd80b593f8d6e12429b54c0c1aa17b82a035b639 Mon Sep 17 00:00:00 2001 From: zYne Date: Sat, 11 Nov 2006 19:51:51 +0000 Subject: [PATCH] Small fixes --- lib/Doctrine/RawSql.php | 11 +++++++---- lib/Doctrine/Record.php | 2 ++ lib/Doctrine/Table.php | 6 +++--- tests/TableTestCase.php | 3 --- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/Doctrine/RawSql.php b/lib/Doctrine/RawSql.php index 1e6295f8f..bfae7f839 100644 --- a/lib/Doctrine/RawSql.php +++ b/lib/Doctrine/RawSql.php @@ -193,13 +193,13 @@ class Doctrine_RawSql extends Doctrine_Hydrate { * @return Doctrine_RawSql */ public function addComponent($tableAlias, $componentName) { - $e = explode(".", $componentName); + $e = explode('.', $componentName); $currPath = ''; $table = null; foreach($e as $k => $component) { - $currPath .= '.'.$component; + $currPath .= '.' . $component; if($k == 0) $currPath = substr($currPath,1); @@ -209,8 +209,11 @@ class Doctrine_RawSql extends Doctrine_Hydrate { $alias = $tableAlias; if ($table) { - $t_name = $table->getAliasName($component); - $table = $this->connection->getTable($t_name); + + $tableName = $table->getAliasName($component); + + + $table = $this->connection->getTable($tableName); } else { $table = $this->connection->getTable($component); } diff --git a/lib/Doctrine/Record.php b/lib/Doctrine/Record.php index e13f1841f..26c065507 100644 --- a/lib/Doctrine/Record.php +++ b/lib/Doctrine/Record.php @@ -122,6 +122,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite * @param Doctrine_Table|null $table a Doctrine_Table object or null, * if null the table object is retrieved from current connection * + * @param boolean $isNewEntry whether or not this record is transient + * * @throws Doctrine_Connection_Exception if object is created using the new operator and there are no * open connections * @throws Doctrine_Record_Exception if the cleanData operation fails somehow diff --git a/lib/Doctrine/Table.php b/lib/Doctrine/Table.php index 4d31e06fa..1855e0ea7 100644 --- a/lib/Doctrine/Table.php +++ b/lib/Doctrine/Table.php @@ -514,7 +514,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable { * @param string $name * @return string */ - final public function getAlias($name) { + public function getAlias($name) { if(isset($this->boundAliases[$name])) return $this->boundAliases[$name]; @@ -526,11 +526,11 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable { * @param string $alias * @return string */ - final public function getAliasName($alias) { + public function getAliasName($alias) { if($name = array_search($alias, $this->boundAliases)) return $name; - throw new Doctrine_Table_Exception('Unknown alias '.$alias); + return $alias; } /** * unbinds all relations diff --git a/tests/TableTestCase.php b/tests/TableTestCase.php index c79c00d0b..0261bdc05 100644 --- a/tests/TableTestCase.php +++ b/tests/TableTestCase.php @@ -164,9 +164,6 @@ class Doctrine_TableTestCase extends Doctrine_UnitTestCase { $this->assertTrue(is_array($columns)); } - public function testIsNewEntry() { - $this->assertFalse($this->objTable->isNewEntry()); - } public function testApplyInheritance() { $this->assertEqual($this->objTable->applyInheritance("id = 3"), "id = 3 AND type = ?"); }