Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 1546 | Rev 4113 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1546 Rev 1662
Línea 43... Línea 43...
43
    public function __invoke($user_id)
43
    public function __invoke($user_id)
44
    {
44
    {
45
        $userMapper = UserMapper::getInstance($this->adapter);
45
        $userMapper = UserMapper::getInstance($this->adapter);
46
        $user = $userMapper->fetchOne($user_id);
46
        $user = $userMapper->fetchOne($user_id);
Línea -... Línea 47...
-
 
47
        
-
 
48
        if($user) {
-
 
49
            $user_uuid = $user->uuid;
-
 
50
            $fullname = trim($user->first_name . ' ' . $user->last_name);
47
        
51
            
48
        $profileVisitMapper = ProfileVisitMapper::getInstance($this->adapter);
52
            $profileVisitMapper = ProfileVisitMapper::getInstance($this->adapter);
49
        $visits = $profileVisitMapper->getTotalByVisitedId($user->id);
53
            $visits = $profileVisitMapper->getTotalByVisitedId($user->id);
50
        
54
            
51
        $connectionMapper = ConnectionMapper::getInstance($this->adapter);
55
            $connectionMapper = ConnectionMapper::getInstance($this->adapter);
52
        $connections = $connectionMapper->fetchTotalConnectionByUser($user->id);
56
            $connections = $connectionMapper->fetchTotalConnectionByUser($user->id);
53
        
57
            
54
        
58
            
55
        if($user->location_id) {
59
            if($user->location_id) {
56
            $locationMapper = LocationMapper::getInstance($this->adapter);
60
                $locationMapper = LocationMapper::getInstance($this->adapter);
-
 
61
                $location = $locationMapper->fetchOne($user->location_id);
-
 
62
                
-
 
63
                $country = $location->country;
-
 
64
            } else {
-
 
65
                $country = '';
-
 
66
            }
-
 
67
            
Línea -... Línea 68...
-
 
68
          
57
            $location = $locationMapper->fetchOne($user->location_id);
69
            
-
 
70
            $userMapper = UserMapper::getInstance($this->adapter);
-
 
71
            $user = $userMapper->fetchOne($user_id);
-
 
72
            if($user && $user->usertype_id == UserType::ADMIN) {
-
 
73
                $link_admin = '/backend/signin-admin';
-
 
74
            } else {
58
            
75
                $link_admin = '';
-
 
76
            } 
-
 
77
        } else {
59
            $country = $location->country;
78
            $user_uuid= '';
60
        } else {
-
 
61
            $country = '';
-
 
62
        }
-
 
63
        
-
 
64
      
-
 
65
        
-
 
66
        $userMapper = UserMapper::getInstance($this->adapter);
-
 
67
        $user = $userMapper->fetchOne($user_id);
79
            $fullname = '';
68
        if($user && $user->usertype_id == UserType::ADMIN) {
80
            $country = '';
69
            $link_admin = '/backend/signin-admin';
81
            $visits = 0;
70
        } else {
82
            $connections = 0;
Línea 71... Línea 83...
71
            $link_admin = '';
83
            $link_admin = '';
72
        } 
84
        }
73
        
85
        
74
        $data = [
86
        $data = [
75
            'user_uuid' => $user->uuid,
87
            'user_uuid' =>  $user_uuid,
76
            'fullname' => trim($user->first_name . ' ' . $user->last_name),
88
            'fullname' => $fullname,
77
            'country' => $country,
89
            'country' => $country,
78
            'visits' => $visits,
90
            'visits' => $visits,