From 00f274c6178aeef59b2bdd5de51a5591d14b212c Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Wed, 8 May 2013 09:14:19 -0700 Subject: [PATCH] Bug fixes --- src/GeoIP2/Model/City.php | 13 ++++++------- src/GeoIP2/Record/City.php | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/GeoIP2/Model/City.php b/src/GeoIP2/Model/City.php index ecd5c46..2e53222 100644 --- a/src/GeoIP2/Model/City.php +++ b/src/GeoIP2/Model/City.php @@ -4,21 +4,20 @@ namespace GeoIP2\Model; class City extends Country { - //XXX use properties - private $city; - private $location; - private $postal; - private $subdivisions = Array(); + protected $city; + protected $location; + protected $postal; + protected $subdivisions = Array(); public function __construct($raw, $languages) { + parent::__construct($raw, $languages); + $this->city = new \GeoIP2\Record\City($this->get('city'), $languages); $this->location = new \GeoIP2\Record\Location($this->get('location')); $this->postal = new \GeoIP2\Record\Postal($this->get('postal')); $this->createSubdivisions($raw, $languages); - - parent::__construct($raw, $languages); } private function createSubdivisions($raw, $languages) { diff --git a/src/GeoIP2/Record/City.php b/src/GeoIP2/Record/City.php index 4606fb7..26f9875 100644 --- a/src/GeoIP2/Record/City.php +++ b/src/GeoIP2/Record/City.php @@ -4,5 +4,5 @@ namespace GeoIP2\Record; class City extends AbstractPlaceRecord { - protected $validAttribute = Array('confidence', 'geonameId', 'names'); + protected $validAttributes = Array('confidence', 'geonameId', 'names'); } \ No newline at end of file