|
@@ 142-148 (lines=7) @@
|
| 139 |
|
$defaultValue = isset($args[$idField]) && is_numeric($args[$idField]) ? $args[$idField] : 0; |
| 140 |
|
if ($this->selectionHelper->hasCompositeKeys($objectType)) { |
| 141 |
|
// composite key may be alphanumeric |
| 142 |
|
if (array_key_exists($idField, $routeParams)) { |
| 143 |
|
$id = !empty($routeParams[$idField]) ? $routeParams[$idField] : $defaultValue; |
| 144 |
|
} elseif ($request->query->has($idField)) { |
| 145 |
|
$id = $request->query->getAlnum($idField, $defaultValue); |
| 146 |
|
} else { |
| 147 |
|
$id = $defaultValue; |
| 148 |
|
} |
| 149 |
|
} else { |
| 150 |
|
// single identifier |
| 151 |
|
if (array_key_exists($idField, $routeParams)) { |
|
@@ 149-158 (lines=10) @@
|
| 146 |
|
} else { |
| 147 |
|
$id = $defaultValue; |
| 148 |
|
} |
| 149 |
|
} else { |
| 150 |
|
// single identifier |
| 151 |
|
if (array_key_exists($idField, $routeParams)) { |
| 152 |
|
$id = (int) !empty($routeParams[$idField]) ? $routeParams[$idField] : $defaultValue; |
| 153 |
|
} elseif ($request->query->has($idField)) { |
| 154 |
|
$id = $request->query->getInt($idField, $defaultValue); |
| 155 |
|
} else { |
| 156 |
|
$id = $defaultValue; |
| 157 |
|
} |
| 158 |
|
} |
| 159 |
|
|
| 160 |
|
// fallback if id has not been found yet |
| 161 |
|
if (!$id && $idField != 'id' && count($idFields) == 1) { |