model/db/db.php
public function aliasSet( $value )
	{
		$columns = $this->getColumns();
		$this->aliasGet( $oldValue );
		foreach( $columns as &$column )
		{
			$tableAlias = $column[0];
			if( $tableAlias === $oldValue )
			{
				$column[0] = $value;
			}
		}

		$select = $this->getSelect();
		$from = $select->getPart( Zend_Db_Select::FROM );
		$select->reset( Zend_Db_Select::FROM );
		foreach( $from as $tableAlias => $descriptor )
		{
			if( $tableAlias === $oldValue )
			{
				unset($from[$oldValue]);
				$from[$value] = $descriptor;
			}
		}
		$select->from( array( $value => $this->getTable() ), array() );

		return $this
			->setAlias( $value )
			->resetColumns( $columns )
		;
	}
public function aliasSet( $value )
	{
		$columns = $this->getColumns();
		$this->aliasGet( $oldValue );
		foreach( $columns as &$column )
		{
			$tableAlias = $column[0];
			if( $tableAlias === $oldValue )
			{
				$column[0] = $value;
			}
		}

		$select = $this->getSelect();
		$from = $select->getPart( Zend_Db_Select::FROM );
		$select->reset( Zend_Db_Select::FROM );
		foreach( $from as $tableAlias => $descriptor )
		{
			if( $tableAlias === $oldValue )
			{
				unset($from[$oldValue]);
				$from[$value] = $descriptor;
			}
		}
		$select->from( array( $value => $this->getTable() ), array() );

		return $this
			->setAlias( $value )
			->resetColumns( $columns )
		;
	}
public function aliasSet ( $ value ) { $ columns = $ this -> getColumns ( ) ; $ this -> aliasGet ( $ oldValue ) ; foreach ( $ columns as & $ column ) { $ tableAlias = $ column [ 0 ] ; if ( $ tableAlias === $ oldValue ) { $ column [ 0 ] = $ value ; } } $ select = $ this -> getSelect ( ) ; $ from = $ select -> getPart ( Zend_Db_Select :: FROM ) ; $ select -> reset ( Zend_Db_Select :: FROM ) ; foreach ( $ from as $ tableAlias => $ descriptor ) { if ( $ tableAlias === $ oldValue ) { unset ( $ from [ $ oldValue ] ) ; $ from [ $ value ] = $ descriptor ; } } $ select -> from ( array ( $ value => $ this -> getTable ( ) ) , array ( ) ) ; return $ this -> setAlias ( $ value ) -> resetColumns ( $ columns ) ; }
Replaces current alias with different one.
@param string $value
@return $this
@see setAlias version that do not replaces currently set columns
Replaces current alias with different one .