/**
  * Generate a SURN,GIVN and GIVN,SURN sortable name for an individual.
  * This allows table data to sort by surname or given names.
  *
  * Use AAAA as a separator (instead of ","), as Javascript localeCompare()
  * ignores punctuation and "ANN,ROACH" would sort after "ANNE,ROACH",
  * instead of before it.
  *
  * @param Individual $individual
  *
  * @return string[]
  */
 private static function sortableNames(Individual $individual)
 {
     $names = $individual->getAllNames();
     $primary = $individual->getPrimaryName();
     list($surn, $givn) = explode(',', $names[$primary]['sort']);
     $givn = str_replace('@P.N.', 'AAAA', $givn);
     $surn = str_replace('@N.N.', 'AAAA', $surn);
     return array($surn . 'AAAA' . $givn, $givn . 'AAAA' . $surn);
 }