Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ php:
- 5.6
- 7.0
- 7.1
- 7.2
- hhvm
- nightly

Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/Connection/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private function _executeDeletions(array $deletions)
$params = array();
$columnNames = array();
foreach ($identifierMaps as $idMap) {
while (list($fieldName, $value) = each($idMap)) {
foreach($idMap as $fieldName => $value) {
$params[] = $value;
$columnNames[] = $table->getColumnName($fieldName);
}
Expand Down Expand Up @@ -957,4 +957,4 @@ protected function _assignIdentifier(Doctrine_Record $record)
$record->assignIdentifier(true);
}
}
}
}
17 changes: 9 additions & 8 deletions lib/Doctrine/Hydrator/Graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function hydrateResultSet($stmt)
} else if ( ! isset($prev[$parent][$relationAlias])) {
$element = $this->getElement($data, $componentName);

// [FIX] Tickets #1205 and #1237
// [FIX] Tickets #1205 and #1237
$event->set('data', $element);
$listeners[$componentName]->postHydrate($event);
$instances[$componentName]->postHydrate($event);
Expand Down Expand Up @@ -409,20 +409,21 @@ protected function _getClassnameToReturn(array &$data, $component)
$needMatches = count($inheritanceMap);
foreach ($inheritanceMap as $key => $value) {
$key = $this->_tables[$component]->getFieldName($key);
if ( isset($data[$key]) && $data[$key] == $value) {
if (isset($data[$key]) && $data[$key] == $value) {
--$needMatches;
}
}
if ($needMatches == 0) {
$matchedComponents[] = $table->getComponentName();
}
} else {
list($key, $value) = each($inheritanceMap);
$key = $this->_tables[$component]->getFieldName($key);
if ( ! isset($data[$key]) || $data[$key] != $value) {
continue;
} else {
$matchedComponents[] = $table->getComponentName();
foreach ($inheritanceMap as $key => $value) {
$key = $this->_tables[$component]->getFieldName($key);
if (!isset($data[$key]) || $data[$key] != $value) {
continue;
} else {
$matchedComponents[] = $table->getComponentName();
}
}
}
}
Expand Down