Allow Zend\Db\Sql\TableIdentifier in Zend\Db\Sql\Insert, Update & Delete #2809

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

pozs commented Oct 19, 2012

With this patch Zend\Db\Sql\TableIdentifier is allowed in

  • Zend\Db\Sql\Insert::__construct()
  • Zend\Db\Sql\Insert::into()
  • Zend\Db\Sql\Update::__construct()
  • Zend\Db\Sql\Update::table()
  • Zend\Db\Sql\Delete::__construct()
  • Zend\Db\Sql\Delete::from()

Previously it was already accepted by

  • Zend\Db\Sql\Sql::__construct()
  • Zend\Db\Sql\Select::__construct()
  • Zend\Db\Sql\Select::from()

Before, while this code worked:

$sql = new Sql($tableIdentifier);
$sql->select();
...

These failed:

$sql = new Sql($tableIdentifier);
$sql->insert();
...
$sql->update();
...
$sql->delete();
...

This patch would be essential to those, who works with multiple schemas simultaneously.

@pozs pozs Zend\Db\Sql\TableIdentifier now allowed in Zend\Db\Sql\Insert::into()…
…, Update::table() & Delete::from() (not only in Select::from() & Sql::__construct())
ac15221
Owner

weierophinney commented Oct 30, 2012

Can you provide some unit tests, please?

Member

ralphschindler commented Jan 4, 2013

Excellent Patch, I've merged to develop branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment