Zend Framework

Zend_Db_Select::assemble will return null or string.

Details

  • Type: Docs:  Improvement Docs: Improvement
  • Status: Resolved Resolved
  • Priority: Trivial Trivial
  • Resolution: Fixed
  • Affects Version/s: 1.8.2
  • Fix Version/s: None
  • Component/s: Zend_Db_Select
  • Labels:
    None

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.

Activity

Hide
Ralph Schindler added a comment -

Fixed in r16814

Show
Ralph Schindler added a comment - Fixed in r16814

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: