Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
N/A
-
Resolution: Duplicate
-
Affects Version/s: 1.7.5
-
Fix Version/s: None
-
Component/s: Zend_Db_Table
-
Labels:None
Description
Zend_Db_Table_Select doesn't allow use of $select->columns('..')
code fragment:
$tbl = new Category_Table();
$select = $tbl->select()->columns('id');
Results:
Zend_Db_Select_Exception: No table has been specified for the FROM clause in /usr/share/php/Zend-1.7.5/Db/Select.php on line 224
Expected:
Zend_Db_Table_Select should already have a table when created from a Zend_Db_Table_Abstract.
Bug?:
Zend_Db_Table_Select's from clause isn't set till assemble()
Agreed.
I already told Zend (ralph probably) that a Zend_Db_Table_Select should be given it's own table in the from clause, just after creating it.
It's not logic to have a Zend_Db_Table_Select entirely empty at creation, it should at least contains its own table as its first from clause.
See :
// that's not logic $table->fetchall($table->select()->from($table, array('my', 'cols')));// that seems more logic $table->fetchall($table->select()->columns(array('my', 'cols')));// that's not logic $table->fetchall($table->select()->from($table, array('my', 'cols')));// that seems more logic $table->fetchall($table->select()->columns(array('my', 'cols')));