Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Zend\Db\Sql setTable method ommit array #4290

Merged
merged 5 commits into from May 9, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions library/Zend/Db/Sql/Select.php
Expand Up @@ -96,7 +96,7 @@ class Select extends AbstractSql implements SqlInterface, PreparableSqlInterface
protected $prefixColumnsWithTable = true;

/**
* @var string|TableIdentifier
* @var string|array|TableIdentifier
*/
protected $table = null;

Expand Down Expand Up @@ -148,7 +148,7 @@ class Select extends AbstractSql implements SqlInterface, PreparableSqlInterface
/**
* Constructor
*
* @param null|string $table
* @param null|string|array|TableIdentifier $table
*/
public function __construct($table = null)
{
Expand Down
6 changes: 3 additions & 3 deletions library/Zend/Db/Sql/Sql.php
Expand Up @@ -18,7 +18,7 @@ class Sql
/** @var AdapterInterface */
protected $adapter = null;

/** @var string */
/** @var string|array|TableIdentifier */
protected $table = null;

/** @var Platform\Platform */
Expand Down Expand Up @@ -48,10 +48,10 @@ public function hasTable()

public function setTable($table)
{
if (is_string($table) || $table instanceof TableIdentifier) {
if (is_string($table) || is_array($table) || $table instanceof TableIdentifier) {
$this->table = $table;
} else {
throw new Exception\InvalidArgumentException('Table must be a string or instance of TableIdentifier.');
throw new Exception\InvalidArgumentException('Table must be a string, array or instance of TableIdentifier.');
}
return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ZendTest/Db/Sql/SqlTest.php
Expand Up @@ -52,7 +52,7 @@ public function test__construct()
$sql->setTable('foo');
$this->assertSame('foo', $sql->getTable());

$this->setExpectedException('Zend\Db\Sql\Exception\InvalidArgumentException', 'Table must be a string or instance of TableIdentifier.');
$this->setExpectedException('Zend\Db\Sql\Exception\InvalidArgumentException', 'Table must be a string, array or instance of TableIdentifier.');
$sql->setTable(null);
}

Expand Down