See Release Notes
Long Term Support Release
Differences Between: [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]
1 <?php 2 3 namespace GeoIp2\Record; 4 5 abstract class AbstractPlaceRecord extends AbstractRecord 6 { 7 private $locales; 8 9 /** 10 * @ignore 11 * 12 * @param mixed $record 13 * @param mixed $locales 14 */ 15 public function __construct($record, $locales = ['en']) 16 { 17 $this->locales = $locales; 18 parent::__construct($record); 19 } 20 21 /** 22 * @ignore 23 * 24 * @param mixed $attr 25 */ 26 public function __get($attr) 27 { 28 if ($attr === 'name') { 29 return $this->name(); 30 } 31 32 return parent::__get($attr); 33 } 34 35 /** 36 * @ignore 37 * 38 * @param mixed $attr 39 */ 40 public function __isset($attr) 41 { 42 if ($attr === 'name') { 43 return $this->firstSetNameLocale() === null ? false : true; 44 } 45 46 return parent::__isset($attr); 47 } 48 49 private function name() 50 { 51 $locale = $this->firstSetNameLocale(); 52 53 return $locale === null ? null : $this->names[$locale]; 54 } 55 56 private function firstSetNameLocale() 57 { 58 foreach ($this->locales as $locale) { 59 if (isset($this->names[$locale])) { 60 return $locale; 61 } 62 } 63 64 return null; 65 } 66 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body