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

Commit

Permalink
Merge branch 'hotfix/395'
Browse files Browse the repository at this point in the history
Close #395
  • Loading branch information
michalbundyra committed Dec 31, 2019
2 parents 7f20ba3 + 9d99d20 commit db047ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ All notable changes to this project will be documented in this file, in reverse

### Fixed

- [#382](https://github.com/zendframework/zend-db/pull/382) fixes `Zend\Db\Sql\Expression` to allow `0` value for parameter
- [#382](https://github.com/zendframework/zend-db/pull/382) fixes `Zend\Db\Sql\Expression` to allow `0` value for parameter.

- [#395](https://github.com/zendframework/zend-db/pull/395) fixes PHP 7.4 compatibility.

## 2.10.0 - 2019-02-25

Expand Down
4 changes: 3 additions & 1 deletion src/RowGateway/AbstractRowGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ public function delete()
$where = [];
// primary key is always an array even if its a single column
foreach ($this->primaryKeyColumn as $pkColumn) {
$where[$pkColumn] = $this->primaryKeyData[$pkColumn];
$where[$pkColumn] = isset($this->primaryKeyData[$pkColumn])
? $this->primaryKeyData[$pkColumn]
: null;
}

// @todo determine if we need to do a select to ensure 1 row will be affected
Expand Down
6 changes: 4 additions & 2 deletions src/TableGateway/AbstractTableGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ public function selectWith(Select $select)
protected function executeSelect(Select $select)
{
$selectState = $select->getRawState();
if ($selectState['table'] != $this->table
if (isset($selectState['table'])
&& $selectState['table'] != $this->table
&& (is_array($selectState['table'])
&& end($selectState['table']) != $this->table)
) {
Expand All @@ -225,7 +226,8 @@ protected function executeSelect(Select $select)
);
}

if ($selectState['columns'] == [Select::SQL_STAR]
if (isset($selectState['columns'])
&& $selectState['columns'] == [Select::SQL_STAR]
&& $this->columns !== []) {
$select->columns($this->columns);
}
Expand Down

0 comments on commit db047ba

Please sign in to comment.