protected function attachResponses($identities, $responses, $key)
{
if (is_array($identities)) {
foreach ($identities as $identity) {
if ($identity instanceof Summoner) {
$id = $identity->id;
if (isset($responses[$id])) {
$response = $responses[$id];
$this->attachResponse($identity, $response, $key);
} else {
// we did not get a response for this id, attach null
$this->attachResponse($identity, null, $key);
}
}
}
} else {
$identity = $identities;
if ($identity instanceof Summoner) {
$id = $identity->id;
if (isset($responses[$id])) {
$response = $responses[$id];
$this->attachResponse($identity, $response, $key);
} else {
// we did not get a response for this id, attach null
$this->attachResponse($identity, null, $key);
}
}
}
return true;
}