Merge branch 'xorg/1.0.2/master' into xorg/master
[platal.git] / classes / address.php
index 7757e02..6c1880b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2010 Polytechnique.org                              *
+ *  Copyright (C) 2003-2011 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -366,7 +366,7 @@ class Address
 
     public function addPhone(Phone &$phone)
     {
-        if ($phone->linkType() == Phone::LINK_ADDRESS && $phone->pid() == $this->pid) {
+        if ($phone->link_type == Phone::LINK_ADDRESS && $phone->pid == $this->pid) {
             $this->phones[$phone->uniqueId()] = $phone;
         }
     }
@@ -874,7 +874,7 @@ class AddressIterator implements PlIterator
                         gl.name AS locality, gl.nameLocal AS localityLocal,
                         gs.name AS subAdministrativeArea, gs.nameLocal AS subAdministrativeAreaLocal,
                         ga.name AS administrativeArea, ga.nameLocal AS administrativeAreaLocal,
-                        gc.country, gc.countryLocal
+                        gc.country
                   FROM  profile_addresses             AS pa
              LEFT JOIN  geoloc_localities             AS gl ON (gl.id = pa.localityId)
              LEFT JOIN  geoloc_administrativeareas    AS ga ON (ga.id = pa.administrativeAreaId)
@@ -897,7 +897,7 @@ class AddressIterator implements PlIterator
         // Adds phones to addresses.
         $it = Phone::iterate(array($data['pid']), array(Phone::LINK_ADDRESS), array($data['id']));
         while ($phone = $it->next()) {
-            $data['phones'][$phone->id()] = $phone->toFormArray();
+            $data['phones'][$phone->id] = $phone->toFormArray();
         }
         return new Address($data);
     }