コード例 #1
0
ファイル: user_selector.php プロジェクト: vazahat/dudex
 public function getList()
 {
     $users = null;
     $count = null;
     if ($this->friendsMode) {
         $count = OW::getEventManager()->call('plugin.friends.count_friends', array('userId' => $this->userId));
         $users = OW::getEventManager()->call('plugin.friends.get_friend_list', array('userId' => $this->userId, 'count' => 500));
     }
     $hideUsers = array();
     if (!empty($this->entityId)) {
         $sentNotifications = EQUESTIONS_BOL_NotificationService::getInstance()->findSentNotificationList($this->entityId, $this->userId, 'ask');
         foreach ($sentNotifications as $notification) {
             $hideUsers[] = $notification->userId;
         }
     }
     if ($count === null) {
         $count = BOL_UserService::getInstance()->count();
     }
     if ($users === null) {
         $users = array();
         $userDtos = BOL_UserService::getInstance()->findRecentlyActiveList(0, 500);
         foreach ($userDtos as $u) {
             if ($u->id != $this->userId) {
                 $users[] = $u->id;
             }
         }
     }
     $out = array();
     foreach ($users as $user) {
         if (!in_array($user, $hideUsers)) {
             $out[] = $user;
         }
     }
     return array('count' => $count - 1, 'idList' => $out);
 }
コード例 #2
0
ファイル: invitations_bridge.php プロジェクト: vazahat/dudex
 private function __construct()
 {
     $this->service = EQUESTIONS_BOL_NotificationService::getInstance();
 }