From dbcc3b3d73d14d7c6843397ce2b3a12f0b60e3e1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Thu, 24 Jun 2010 00:28:21 +0200 Subject: [PATCH] Fix fetching of phones for user addresses MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- classes/profile.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/classes/profile.php b/classes/profile.php index d75bf76..9924eb4 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -516,14 +516,20 @@ class Profile $this->consolidateFields(); } - public function getAddresses($flags, $limit = null) + private function fetchAddresses() { if ($this->addresses == null && !$this->fetched(self::FETCH_ADDRESSES)) { $addr = $this->getProfileField(self::FETCH_ADDRESSES); if ($addr) { $this->setAddresses($addr); + $this->fetchPhones(); } } + } + + public function getAddresses($flags, $limit = null) + { + $this->fetchAddresses(); if ($this->addresses == null) { return array(); @@ -555,12 +561,16 @@ class Profile $this->consolidateFields(); } - public function getPhones($flags, $limit = null) + private function fetchPhones() { if ($this->phones == null && !$this->fetched(self::FETCH_PHONES)) { $this->setPhones($this->getProfileField(self::FETCH_PHONES)); } + } + public function getPhones($flags, $limit = null) + { + $this->fetchPhones(); if ($this->phones == null) { return array(); } @@ -650,14 +660,20 @@ class Profile $this->consolidateFields(); } - public function getJobs($flags, $limit = null) + private function fetchJobs() { if ($this->jobs == null && !$this->fetched(self::FETCH_JOBS)) { $jobs = $this->getProfileField(self::FETCH_JOBS); if ($jobs) { $this->setJobs($jobs); + $this->fetchAddresses(); } } + } + + public function getJobs($flags, $limit = null) + { + $this->fetchJobs(); if ($this->jobs == null) { return array(); -- 2.1.4