src/IntentAnalyticsModule.php
public function getVisitor()
    {
        if ($this->visitor !== null) {
            return $this->visitor;
        }

        if (Yii::$app->session->has($this->visitorCookieName)) {
            $visitor_id = Yii::$app->session->get($this->visitorCookieName);
        } elseif (Yii::$app->request->cookies->has($this->visitorCookieName)) {
            $visitor_id = Yii::$app->request->cookies->getValue($this->visitorCookieName);
        }
        if (isset($visitor_id) && $this->hasVisitor($visitor_id)) {
            return $this->visitor;
        }

        return $this->createVisitor();
    }
public function getVisitor()
    {
        if ($this->visitor !== null) {
            return $this->visitor;
        }

        if (Yii::$app->session->has($this->visitorCookieName)) {
            $visitor_id = Yii::$app->session->get($this->visitorCookieName);
        } elseif (Yii::$app->request->cookies->has($this->visitorCookieName)) {
            $visitor_id = Yii::$app->request->cookies->getValue($this->visitorCookieName);
        }
        if (isset($visitor_id) && $this->hasVisitor($visitor_id)) {
            return $this->visitor;
        }

        return $this->createVisitor();
    }
public function getVisitor ( ) { if ( $ this -> visitor !== null ) { return $ this -> visitor ; } if ( Yii :: $ app -> session -> has ( $ this -> visitorCookieName ) ) { $ visitor_id = Yii :: $ app -> session -> get ( $ this -> visitorCookieName ) ; } elseif ( Yii :: $ app -> request -> cookies -> has ( $ this -> visitorCookieName ) ) { $ visitor_id = Yii :: $ app -> request -> cookies -> getValue ( $ this -> visitorCookieName ) ; } if ( isset ( $ visitor_id ) && $ this -> hasVisitor ( $ visitor_id ) ) { return $ this -> visitor ; } return $ this -> createVisitor ( ) ; }
Return current Visitor

@return Visitor
Return current Visitor