diff --git a/library/Zend/Db/Adapter/Adapter.php b/library/Zend/Db/Adapter/Adapter.php index b4c7edffffd..6cea6bbe9a2 100644 --- a/library/Zend/Db/Adapter/Adapter.php +++ b/library/Zend/Db/Adapter/Adapter.php @@ -160,6 +160,7 @@ public function getCurrentSchema() * * @param string $sql * @param string|array|ParameterContainer $parametersOrQueryMode + * @param \Zend\Db\ResultSet\ResultSetInterface $resultPrototype * @throws Exception\InvalidArgumentException * @return Driver\StatementInterface|ResultSet\ResultSet */ diff --git a/library/Zend/Db/Adapter/AdapterInterface.php b/library/Zend/Db/Adapter/AdapterInterface.php index 57a6a73763c..d9fdb561a7c 100644 --- a/library/Zend/Db/Adapter/AdapterInterface.php +++ b/library/Zend/Db/Adapter/AdapterInterface.php @@ -9,6 +9,8 @@ namespace Zend\Db\Adapter; +use Zend\Db\ResultSet; + /** * * @property Driver\DriverInterface $driver @@ -25,4 +27,15 @@ public function getDriver(); * @return Platform\PlatformInterface */ public function getPlatform(); + + /** + * query() is a convenience function + * + * @param string $sql + * @param string|array|ParameterContainer $parametersOrQueryMode + * @param \Zend\Db\ResultSet\ResultSetInterface $resultPrototype + * @throws Exception\InvalidArgumentException + * @return Driver\StatementInterface|ResultSet\ResultSet + */ + public function query($sql, $parametersOrQueryMode, ResultSet\ResultSetInterface $resultPrototype = null); } diff --git a/library/Zend/Db/Sql/Ddl/Column/Blob.php b/library/Zend/Db/Sql/Ddl/Column/Blob.php index 1892ca6039b..4c7dbd0c2a4 100644 --- a/library/Zend/Db/Sql/Ddl/Column/Blob.php +++ b/library/Zend/Db/Sql/Ddl/Column/Blob.php @@ -22,11 +22,11 @@ class Blob extends Column protected $type = 'BLOB'; /** - * @param null $name - * @param int $length - * @param bool $nullable - * @param null $default - * @param array $options + * @param string $name + * @param int $length + * @param bool $nullable + * @param null $default + * @param array $options */ public function __construct($name, $length, $nullable = false, $default = null, array $options = array()) { diff --git a/library/Zend/Db/Sql/Ddl/Column/ColumnInterface.php b/library/Zend/Db/Sql/Ddl/Column/ColumnInterface.php index 331e5254f44..282f44b4874 100644 --- a/library/Zend/Db/Sql/Ddl/Column/ColumnInterface.php +++ b/library/Zend/Db/Sql/Ddl/Column/ColumnInterface.php @@ -11,10 +11,30 @@ use Zend\Db\Sql\ExpressionInterface; +/** + * Interface ColumnInterface describes the protocol on how Column objects interact + * + * @package Zend\Db\Sql\Ddl\Column + */ interface ColumnInterface extends ExpressionInterface { + /** + * @return string + */ public function getName(); + + /** + * @return bool + */ public function isNullable(); + + /** + * @return null|string|int + */ public function getDefault(); + + /** + * @return array + */ public function getOptions(); } diff --git a/library/Zend/Db/Sql/Ddl/Constraint/UniqueKey.php b/library/Zend/Db/Sql/Ddl/Constraint/UniqueKey.php index 8d871054e18..43d0115c6d0 100644 --- a/library/Zend/Db/Sql/Ddl/Constraint/UniqueKey.php +++ b/library/Zend/Db/Sql/Ddl/Constraint/UniqueKey.php @@ -17,12 +17,12 @@ class UniqueKey extends AbstractConstraint protected $specification = 'CONSTRAINT UNIQUE KEY %s(...)'; /** - * @param string $column + * @param array $columns * @param null|string $name */ - public function __construct($column, $name = null) + public function __construct($columns, $name = null) { - $this->setColumns($column); + $this->setColumns($columns); $this->name = $name; } diff --git a/tests/ZendTest/Db/TableGateway/Feature/FeatureSetTest.php b/tests/ZendTest/Db/TableGateway/Feature/FeatureSetTest.php index 5fb880491d8..9ae4ad36258 100644 --- a/tests/ZendTest/Db/TableGateway/Feature/FeatureSetTest.php +++ b/tests/ZendTest/Db/TableGateway/Feature/FeatureSetTest.php @@ -23,7 +23,7 @@ public function testAddFeatureThatFeatureDoesnotHasTableGatewayButFeatureSetHas( { $mockMasterAdapter = $this->getMock( 'Zend\Db\Adapter\AdapterInterface', - array('getDriver', 'getPlatform') + array('getDriver', 'getPlatform', 'query') ); $mockStatement = $this->getMock('Zend\Db\Adapter\Driver\StatementInterface'); @@ -36,7 +36,7 @@ public function testAddFeatureThatFeatureDoesnotHasTableGatewayButFeatureSetHas( $mockSlaveAdapter = $this->getMock( 'Zend\Db\Adapter\AdapterInterface', - array('getDriver', 'getPlatform') + array('getDriver', 'getPlatform', 'query') ); $mockStatement = $this->getMock('Zend\Db\Adapter\Driver\StatementInterface'); diff --git a/tests/ZendTest/Db/TableGateway/Feature/MasterSlaveFeatureTest.php b/tests/ZendTest/Db/TableGateway/Feature/MasterSlaveFeatureTest.php index 8dc9144d147..90419f8d77b 100644 --- a/tests/ZendTest/Db/TableGateway/Feature/MasterSlaveFeatureTest.php +++ b/tests/ZendTest/Db/TableGateway/Feature/MasterSlaveFeatureTest.php @@ -30,7 +30,7 @@ public function setup() { $this->mockMasterAdapter = $this->getMock( 'Zend\Db\Adapter\AdapterInterface', - array('getDriver', 'getPlatform') + array('getDriver', 'getPlatform', 'query') ); $mockStatement = $this->getMock('Zend\Db\Adapter\Driver\StatementInterface'); @@ -43,7 +43,7 @@ public function setup() $this->mockSlaveAdapter = $this->getMock( 'Zend\Db\Adapter\AdapterInterface', - array('getDriver', 'getPlatform') + array('getDriver', 'getPlatform', 'query') ); $mockStatement = $this->getMock('Zend\Db\Adapter\Driver\StatementInterface');