Proyectos de Subversion LeadersLinked - Services

Rev

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

Rev 18 Rev 19
Línea 43... Línea 43...
43
     */
43
     */
44
    public function __construct($adapter) 
44
    public function __construct($adapter) 
45
    {
45
    {
Línea 46... Línea 46...
46
 
46
 
47
        $this->hasNetwork = false;
-
 
48
 
-
 
Línea 49... Línea 47...
49
        
47
        $this->hasNetwork = false;
50
        
48
        
51
        $hostname = empty($_SERVER['HTTP_REFERER']) ?  '' : $_SERVER['HTTP_REFERER'];
49
        $hostname = empty($_SERVER['HTTP_REFERER']) ?  '' : $_SERVER['HTTP_REFERER'];
52
        if(empty($hostname)) {
50
        if(empty($hostname)) {
Línea 57... Línea 55...
57
        $parts = explode('/', $hostname);
55
        $parts = explode('/', $hostname);
58
        $hostname = $parts > 1 ? $parts[0] : $hostname;
56
        $hostname = $parts > 1 ? $parts[0] : $hostname;
Línea 59... Línea 57...
59
        
57
        
60
        $networkMapper = NetworkMapper::getInstance($adapter);
58
        $networkMapper = NetworkMapper::getInstance($adapter);
61
        $this->network = $networkMapper->fetchOneByHostnameForFrontend($hostname);
-
 
Línea 62... Línea 59...
62
 
59
        $this->network = $networkMapper->fetchOneByHostnameForFrontend($hostname);
Línea 63... Línea 60...
63
        
60
        
64
        if($this->network) {
61
        if($this->network) {
65
            
62
            
66
            $this->hostname = $this->network->main_hostname == $hostname ?  $this->network->main_hostname : $this->network->alternative_hostname;
-
 
67
            $this->hasNetwork = true;
63
            $this->hostname = $this->network->main_hostname == $hostname ?  $this->network->main_hostname : $this->network->alternative_hostname;
68
        }
-
 
69
        
-
 
70
    }
-
 
Línea 71... Línea 64...
71
    
64
            $this->hasNetwork = true;
72
    
65
        }
73
 
66
    }
74
 
67
 
75
    /**
68
    /**
76
     * 
69
     * 
77
     * @return \LeadersLinked\Model\Network
-
 
78
     */
70
     * @return \LeadersLinked\Model\Network
79
    public function getNetwork() 
71
     */
80
    {
72
    public function getNetwork() 
81
    
-
 
82
        if($this->hasNetwork) {
73
    {
83
            return $this->network;
74
        if($this->hasNetwork) {
84
        } else {
75
            return $this->network;
85
            
-
 
Línea 86... Línea 76...
86
            return null;
76
        } else {
87
        }
77
            return null;
88
    }
78
        }
89
   
79
    }