Example #1
0
 /**
  * Get string describing birth county
  *
  * @return string One of the birth county identifier constants
  */
 public function getBirthCounty()
 {
     if ($this->getDate() < DateTimeCreator::createFromFormat('Ymd', '19900101')) {
         $countyNr = (int) substr($this->getSerialPostDelimiter(), 0, 2);
         foreach (self::$birthCountyMap as $limit => $identifier) {
             if ($countyNr <= $limit) {
                 return $identifier;
             }
         }
     }
     return Id::COUNTY_UNDEFINED;
 }
Example #2
0
 public function testCreateFromFormatException()
 {
     $this->setExpectedException('byrokrat\\id\\Exception\\InvalidDateStructureException');
     DateTimeCreator::createFromFormat('ymd', '14xx80');
 }