Ejemplo n.º 1
0
 /**
  * Generate the likely value of this census column, based on available information.
  *
  * @param Individual      $individual
  * @param Individual|null $head
  *
  * @return string
  */
 public function generate(Individual $individual, Individual $head = null)
 {
     $birth_place = $individual->getBirthPlace();
     $census_place = $this->place();
     // Ignore the census country
     if ($birth_place === $census_place) {
         return '';
     }
     if (substr($birth_place, -strlen($census_place) - 2) === ', ' . $census_place) {
         return substr($birth_place, 0, -strlen($census_place) - 2);
     } else {
         return $birth_place;
     }
 }
Ejemplo n.º 2
0
 /**
  * Generate the likely value of this census column, based on available information.
  *
  * @param Individual      $individual
  * @param Individual|null $head
  *
  * @return string
  */
 public function generate(Individual $individual, Individual $head = null)
 {
     $place = $individual->getBirthPlace();
     // Did we emigrate or naturalise?
     foreach ($individual->getFacts('IMMI|EMIG|NATU', true) as $fact) {
         if (Date::compare($fact->getDate(), $this->date()) <= 0) {
             $place = $fact->getPlace()->getGedcomName();
         }
     }
     $place = explode(', ', $place);
     $place = end($place);
     if ($place === 'England' || $place === 'Scotland' || $place === 'Wales') {
         return 'British';
     } else {
         return $place;
     }
 }
 /**
  * Generate the likely value of this census column, based on available information.
  *
  * @param Individual      $individual
  * @param Individual|null $head
  *
  * @return string
  */
 public function generate(Individual $individual, Individual $head = null)
 {
     $birth_place = explode(', ', $individual->getBirthPlace());
     $birth_place = end($birth_place);
     $census_place = $this->place();
     if ($birth_place === 'Wales') {
         $birth_place = 'England';
     }
     if ($census_place === 'Wales') {
         $census_place = 'England';
     }
     if ($birth_place === $census_place || $birth_place === '') {
         return '';
     } elseif ($birth_place === 'England' || $birth_place === 'Scotland' || $birth_place === 'Ireland') {
         return substr($birth_place, 0, 1);
     } else {
         return 'F';
     }
 }