private function updateRefs($table_name, $local_id, Reader $reader)
{
$ref_key = $this->getKeyScheme()->getEntityRefKey($table_name, $local_id);
$refs = $this->getDriver()->getRefs($ref_key);
foreach ($refs as $ref) {
$relationship = $this->getMapper()->getEntityMetadata($ref->getSourceClass())->getRelationshipByName($ref->getRelationshipName());
if ($relationship->getSortableBy()) {
$this->updateMaintainedRelationshipSortIndices($relationship, [$ref->getEntityId()], $reader, $local_id);
}
}
}