1
0
mirror of synced 2025-01-22 00:01:40 +03:00

Small fixes

This commit is contained in:
zYne 2006-11-11 19:51:51 +00:00
parent 7d7c47070a
commit cd80b593f8
4 changed files with 12 additions and 10 deletions

View File

@ -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);
}

View File

@ -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

View File

@ -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

View File

@ -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 = ?");
}