*/
public static function get($login)
{
+ if (is_array($login)) {
+ return new Profile($login);
+ }
$pid = self::getPID($login);
if (!is_null($pid)) {
$it = self::iterOverPIDs(array($pid), false);
if ($data == null) {
return null;
} else {
- return new Profile($data);
+ return Profile::get($data);
}
}
Platal::session()->close();
- $order = array(new UFO_Name(UserFilter::LASTNAME), new UFO_Name(UserFilter::FIRSTNAME));
+ $order = array(new UFO_Name(Profile::LASTNAME), new UFO_Name(Profile::FIRSTNAME));
if ($arg0 == 'promo') {
$order = array_unshift($order, new UFO_Promo());
} else {
$pdf = new ContactsPDF();
- $profiles = $filter->getProfiles();
- foreach ($profiles as $p) {
+ $it = $filter->iterProfiles();
+ while ($p = $it->next()) {
$pdf = ContactsPDF::addContact($pdf, $p, $arg0 == 'photos' || $arg1 == 'photos');
}
$pdf->Output();
$page->register_function('display_ical', 'display_ical');
$filter = new UserFilter(new UFC_Contact($user));
+ $profiles = $filter->iterProfiles();
$annivs = Array();
- foreach ($filter->getUsers() as $u) {
- $profile = $u->profile();
+ while ($profile = $profiles->next()) {
$date = strtotime($profile->birthdate);
$tomorrow = $date + 86400;
$annivs[] = array(
- 'timestamp' => strtotime($user->registration_date),
+ 'timestamp' => $date,
'date' => date('Ymd', $date),
'tomorrow' => date('Ymd', $tomorrow),
'hruid' => $profile->hrid(),