From: Raphaël Barrois Date: Fri, 19 Mar 2010 16:37:50 +0000 (+0100) Subject: Flatten results yielded by the various ProfileFields X-Git-Tag: xorg/1.0.0~332^2~37 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=a5a92ae74e11116fdb4833fd1f7ff5bbb8724ad0;p=platal.git Flatten results yielded by the various ProfileFields Signed-off-by: Raphaël Barrois --- diff --git a/include/profilefields.inc.php b/include/profilefields.inc.php index 486016f..5b53a0e 100644 --- a/include/profilefields.inc.php +++ b/include/profilefields.inc.php @@ -428,7 +428,7 @@ class ProfileNetworking extends ProfileField break; } } - return PlIteratorUtils::fromArray($nws); + return PlIteratorUtils::fromArray($nws, 1, true); } } // }}} @@ -528,7 +528,7 @@ class ProfileAddresses extends ProfileField break; } } - return PlIteratorUtils::fromArray($res); + return PlIteratorUtils::fromArray($res, 1, true); } public static function fetchData(array $pids, $visibility) @@ -584,7 +584,7 @@ class ProfilePhones extends ProfileField break; } } - return PlIteratorUtils::fromArray($phones); + return PlIteratorUtils::fromArray($phones, 1, true); } public static function fetchData(array $pids, $visibility) @@ -605,8 +605,9 @@ class ProfileJobs extends ProfileField { private $jobs = array(); - public function __construct(PlIterator $jobs) + public function __construct(PlInnerSubIterator $jobs) { + $this->pid = $jobs->value(); while ($job = $jobs->next()) { $this->jobs[$job['id']] = new Job($job); } @@ -641,7 +642,7 @@ class ProfileJobs extends ProfileField break; } } - return PlIteratorUtils::fromArray($jobs); + return PlIteratorUtils::fromArray($jobs, 1, true); } public function addPhones(ProfilePhones $phones)