/**
  * Get the events of associates.
  *
  * @param Individual $person
  *
  * @return Fact[]
  */
 private static function associateFacts(Individual $person)
 {
     $facts = array();
     $associates = array_merge($person->linkedIndividuals('ASSO'), $person->linkedIndividuals('_ASSO'), $person->linkedFamilies('ASSO'), $person->linkedFamilies('_ASSO'));
     foreach ($associates as $associate) {
         foreach ($associate->getFacts() as $fact) {
             $arec = $fact->getAttribute('_ASSO');
             if (!$arec) {
                 $arec = $fact->getAttribute('ASSO');
             }
             if ($arec && trim($arec, '@') === $person->getXref()) {
                 // Extract the important details from the fact
                 $factrec = '1 ' . $fact->getTag();
                 if (preg_match('/\\n2 DATE .*/', $fact->getGedcom(), $match)) {
                     $factrec .= $match[0];
                 }
                 if (preg_match('/\\n2 PLAC .*/', $fact->getGedcom(), $match)) {
                     $factrec .= $match[0];
                 }
                 if ($associate instanceof Family) {
                     foreach ($associate->getSpouses() as $spouse) {
                         $factrec .= "\n2 _ASSO @" . $spouse->getXref() . '@';
                     }
                 } else {
                     $factrec .= "\n2 _ASSO @" . $associate->getXref() . '@';
                 }
                 $facts[] = new Fact($factrec, $associate, 'asso');
             }
         }
     }
     return $facts;
 }