Details
-
Type:
Docs: Improvement
-
Status:
Resolved
-
Priority:
Trivial
-
Resolution: Fixed
-
Affects Version/s: 1.8.2
-
Fix Version/s: None
-
Component/s: Zend_Db_Select
-
Labels:None
-
Language:English
-
Tags:
Description
The documentation lists string as return type for Zend_Db_Select::assemble().
However, when calling assemble on a vanilla Zend_Db_Select object, the return value will be null.
This is due to _renderColumns() returning null when there is no columns set in the _parts array and all other _render* methods returning the $sql param untouched. The API docs could be improved to list string|null as return type for assemble() to reflect that.
With PHPUnit:
$statement = new Zend_Db_Select;
$sql = $statement->assemble();
$this->assertTrue(is_string($sql));
will fail.
Fixed in r16814