Backend\Modules\Analytics\Form\SettingsType::__construct PHP Method

__construct() public method

public __construct ( string $name, ModulesSettings $settings, Google_Service_Analytics $googleServiceAnalytics )
$name string
$settings common\ModulesSettings
$googleServiceAnalytics Google_Service_Analytics
    public function __construct($name, ModulesSettings $settings, Google_Service_Analytics $googleServiceAnalytics)
    {
        // we don't even have a auth config file yet, let the user upload it
        if ($settings->get('Analytics', 'certificate') === null) {
            $this->form = new SettingsStepAuthConfigFileType($name, $settings);
            return;
        }
        // we are authenticated! Let's see which account the user wants to use
        if ($settings->get('Analytics', 'account') === null) {
            $this->form = new SettingsStepAccountType($name, $settings, $googleServiceAnalytics);
            return;
        }
        // we have an account, but don't know which property to track
        if ($settings->get('Analytics', 'web_property_id') === null) {
            $this->form = new SettingsStepWebPropertyType($name, $settings, $googleServiceAnalytics);
            return;
        }
        // we have an account, but don't know which property to track
        if ($settings->get('Analytics', 'profile') === null) {
            $this->form = new SettingsStepProfileType($name, $settings, $googleServiceAnalytics);
            return;
        }
        $this->form = new Form($name);
    }