+ return PlIteratorUtils::subIterator($data, PlIteratorUtils::arrayValueCallback('pid'));
+ }
+}
+// }}}
+// {{{ class ProfileMentoringCountries [ Field ]
+class ProfileMentoringCountries extends ProfileField
+{
+ public $countries = array();
+
+ public function __construct(PlInnerSubIterator $it)
+ {
+ $this->pid = $it->value();
+ while ($country = $it->next()) {
+ $this->countries[$country['id']] = $country['name'];
+ }
+ }
+
+ public static function fetchData(array $pids, ProfileVisibility $visibility)
+ {
+ $data = XDB::iterator('SELECT pmc.pid, pmc.country AS id, gc.countryFR AS name
+ FROM profile_mentor_country AS pmc
+ LEFT JOIN geoloc_countries AS gc ON (gc.iso_3166_1_a2 = pmc.country)
+ WHERE pmc.pid IN {?}
+ ORDER BY ' . XDB::formatCustomOrder('pmc.pid', $pids),
+ $pids);
+
+ return PlIteratorUtils::subIterator($data, PlIteratorUtils::arrayValueCallback('pid'));