private function addFamilyMembersToRequestData(&$requestData, &$mergingPeople, $role, &$count, $elements) { if (is_array($elements)) { foreach ($elements as $element) { $titleString = $element['title']; $mergeTarget = @$mergingPeople[$titleString]; if (!$mergeTarget && !GedcomUtil::isGedcomTitle($titleString)) { Family::addPersonToRequestData($requestData, $role, $count, $titleString); $count++; } // don't need an else clause here (like we do below) because family merge sources are guaranteed to exist, so target person will always be added } } }