Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Trivial
-
Resolution: Duplicate
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Zend_Db_Select, Zend_Db_Table
-
Labels:None
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);
}
Issue Links
| This issue duplicates: | ||||
| ZF-5830 | Zend_Db_Table_Select doesn't allow use of $select->columns('..') |
|
|
|
ZF-5830is already opened for this.ZF-5830is already opened for this.