ZF-5985: Zend_Db_Select::columns with $correlationName = null
Description
The method columns should provide the default table name when not specified. For example
// Zend_Db_Table_Abstract $table;
$table->select->columns(array('foo', 'bar'));
should be equivalent to
$table->select()->from($table->info(Zend_Db_Table::NAME), array('foo', 'bar'));
Since $table->select(); create a new Zend_Db_Select, it should set the default table to use when invoking methods that sets colums and such when not specified. For now, the first statement will cause a 'No table has been specified for the FROM clause' exception.
A solution would be to change the Zend_Db_Table_Abstract::select() method to :
public function select()
{
require_once 'Zend/Db/Table/Select.php';
$select = new Zend_Db_Table_Select($this);
return $select->from($this->_name);
}
Comments
Posted by Martin Mayer (martin.mayer) on 2009-03-11T19:11:04.000+0000
ZF-5830 is already opened for this.
Posted by old of Satoru Yoshida (yoshida@zend.co.jp) on 2009-05-29T20:01:50.000+0000
Thank you for comment of duplication.