Small fixes
This commit is contained in:
parent
7d7c47070a
commit
cd80b593f8
@ -193,7 +193,7 @@ class Doctrine_RawSql extends Doctrine_Hydrate {
|
|||||||
* @return Doctrine_RawSql
|
* @return Doctrine_RawSql
|
||||||
*/
|
*/
|
||||||
public function addComponent($tableAlias, $componentName) {
|
public function addComponent($tableAlias, $componentName) {
|
||||||
$e = explode(".", $componentName);
|
$e = explode('.', $componentName);
|
||||||
|
|
||||||
$currPath = '';
|
$currPath = '';
|
||||||
$table = null;
|
$table = null;
|
||||||
@ -209,8 +209,11 @@ class Doctrine_RawSql extends Doctrine_Hydrate {
|
|||||||
$alias = $tableAlias;
|
$alias = $tableAlias;
|
||||||
|
|
||||||
if ($table) {
|
if ($table) {
|
||||||
$t_name = $table->getAliasName($component);
|
|
||||||
$table = $this->connection->getTable($t_name);
|
$tableName = $table->getAliasName($component);
|
||||||
|
|
||||||
|
|
||||||
|
$table = $this->connection->getTable($tableName);
|
||||||
} else {
|
} else {
|
||||||
$table = $this->connection->getTable($component);
|
$table = $this->connection->getTable($component);
|
||||||
}
|
}
|
||||||
|
@ -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,
|
* @param Doctrine_Table|null $table a Doctrine_Table object or null,
|
||||||
* if null the table object is retrieved from current connection
|
* 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
|
* @throws Doctrine_Connection_Exception if object is created using the new operator and there are no
|
||||||
* open connections
|
* open connections
|
||||||
* @throws Doctrine_Record_Exception if the cleanData operation fails somehow
|
* @throws Doctrine_Record_Exception if the cleanData operation fails somehow
|
||||||
|
@ -514,7 +514,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
* @param string $name
|
* @param string $name
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
final public function getAlias($name) {
|
public function getAlias($name) {
|
||||||
if(isset($this->boundAliases[$name]))
|
if(isset($this->boundAliases[$name]))
|
||||||
return $this->boundAliases[$name];
|
return $this->boundAliases[$name];
|
||||||
|
|
||||||
@ -526,11 +526,11 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
* @param string $alias
|
* @param string $alias
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
final public function getAliasName($alias) {
|
public function getAliasName($alias) {
|
||||||
if($name = array_search($alias, $this->boundAliases))
|
if($name = array_search($alias, $this->boundAliases))
|
||||||
return $name;
|
return $name;
|
||||||
|
|
||||||
throw new Doctrine_Table_Exception('Unknown alias '.$alias);
|
return $alias;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* unbinds all relations
|
* unbinds all relations
|
||||||
|
@ -164,9 +164,6 @@ class Doctrine_TableTestCase extends Doctrine_UnitTestCase {
|
|||||||
$this->assertTrue(is_array($columns));
|
$this->assertTrue(is_array($columns));
|
||||||
|
|
||||||
}
|
}
|
||||||
public function testIsNewEntry() {
|
|
||||||
$this->assertFalse($this->objTable->isNewEntry());
|
|
||||||
}
|
|
||||||
public function testApplyInheritance() {
|
public function testApplyInheritance() {
|
||||||
$this->assertEqual($this->objTable->applyInheritance("id = 3"), "id = 3 AND type = ?");
|
$this->assertEqual($this->objTable->applyInheritance("id = 3"), "id = 3 AND type = ?");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user