Renamed languages to locales in the code
This commit is contained in:
@@ -4,14 +4,14 @@ namespace GeoIp2\Record;
|
||||
|
||||
abstract class AbstractPlaceRecord extends AbstractRecord
|
||||
{
|
||||
private $languages;
|
||||
private $locales;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
public function __construct($record, $languages)
|
||||
public function __construct($record, $locales)
|
||||
{
|
||||
$this->languages = $languages;
|
||||
$this->locales = $locales;
|
||||
parent::__construct($record);
|
||||
}
|
||||
|
||||
@@ -29,9 +29,9 @@ abstract class AbstractPlaceRecord extends AbstractRecord
|
||||
|
||||
private function name()
|
||||
{
|
||||
foreach ($this->languages as $language) {
|
||||
if (isset($this->names[$language])) {
|
||||
return $this->names[$language];
|
||||
foreach ($this->locales as $locale) {
|
||||
if (isset($this->names[$locale])) {
|
||||
return $this->names[$locale];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace GeoIp2\Record;
|
||||
* @property int $geonameId The GeoName ID for the city. This attribute
|
||||
* is returned by all end points.
|
||||
*
|
||||
* @property string $name The name of the city based on the languages list
|
||||
* @property string $name The name of the city based on the locales list
|
||||
* passed to the constructor. This attribute is returned by all end points.
|
||||
*
|
||||
* @property array $names A array map where the keys are locale codes
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace GeoIp2\Record;
|
||||
* is returned by all end points.
|
||||
*
|
||||
* @property string $name Returns the name of the continent based on the
|
||||
* languages list passed to the constructor. This attribute is returned by
|
||||
* locales list passed to the constructor. This attribute is returned by
|
||||
* all end points.
|
||||
*
|
||||
* @property array $names An array map where the keys are locale codes
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace GeoIp2\Record;
|
||||
* two-character ISO 3166-1 alpha code} for the country. This attribute is
|
||||
* returned by all end points.
|
||||
*
|
||||
* @property string $name The name of the country based on the languages list
|
||||
* @property string $name The name of the country based on the locales list
|
||||
* passed to the constructor. This attribute is returned by all end points.
|
||||
*
|
||||
* @property array $names An array map where the keys are locale codes and
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace GeoIp2\Record;
|
||||
* two-character ISO 3166-1 alpha code} for the country. This attribute is
|
||||
* returned by all end points.
|
||||
*
|
||||
* @property string $name The name of the country based on the languages list
|
||||
* @property string $name The name of the country based on the locales list
|
||||
* passed to the constructor. This attribute is returned by all end points.
|
||||
*
|
||||
* @property array $names An array map where the keys are locale codes and
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace GeoIp2\Record;
|
||||
* http://en.wikipedia.org/wiki/ISO_3166-2 ISO 3166-2 code}. This attribute
|
||||
* is returned by all end points except Country.
|
||||
*
|
||||
* @property string $name The name of the subdivision based on the languages
|
||||
* @property string $name The name of the subdivision based on the locales
|
||||
* list passed to the constructor. This attribute is returned by all end
|
||||
* points except Country.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user