Use WpEngine variables (enterprise plans only)
@return GeotRecord
@throws GeotException
961892
private function wpengine() {
		try {
			return $this->cleanResponse( RecordConverter::wpEngine() );
		} catch ( \Exception $e ) {
			throw new GeotException( $e->getMessage() );
		}
	}
614096
public function setLatLongRect($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Vision\V1\LatLongRect::class);
        $this->lat_long_rect = $var;

        return $this;
    }
94289
public function setLocLon($varValue, \DataContainer $dc)
    {
        if ($varValue != 0)
        {
            if (!Utils::validateLon($varValue))
            {
                throw new \Exception($GLOBALS['TL_LANG']['c4g_maps']['geox_invalid']);
            }
        }
        return $varValue;
    }
814624
protected function getData()
    {
        $ip = $this->getIp();
        $this->setIp($ip);

        // check ip in memory
        $data = array_get($this->store, $ip);

        if (! $data) {
            try {
                $data = $this->getDriver()->get($ip);
            } catch (\Exception $e) {
                throw new GeoIPException('Failed to get geoip data', 0, $e);
            }

            // cache ip data in memory
            $this->store[$ip] = $data;
        }

        return $data;
    }
462463
public function build()
	{
		if($this->displayName == NULL)
			throw new SocialRecordFormatException('SocialRecord: displayName must be specified for instantiation');
		if($this->profileLocation == NULL)
			throw new SocialRecordFormatException('SocialRecord: profileLocation must be specified for instantiation');
		if($this->personalPublicKey == NULL)
			throw new SocialRecordFormatException('SocialRecord: personalPublicKey must be specified for instantiation');
		if($this->accountPublicKey == NULL)
			throw new SocialRecordFormatException('SocialRecord: accountPublicKey must be specified for instantiation');
		if($this->type == NULL)
			throw new SocialRecordFormatException('SocialRecord: type must be specified for instantiation');
		
		if($this->type != SocialRecord::TYPE_PLATFORM && $this->type != SocialRecord::TYPE_USER && $this->type != SocialRecord::TYPE_PAGE)
			throw new SocialRecordFormatException('SocialRecord: Invalid type value [' . $this->type . ']');
		
		if($this->salt == NULL)
			$this->salt = Random::getRandom(SocialRecord::SALT_CHARS/2);
		if($this->datetime == NULL)
			$this->datetime = XSDDateTime::getXSDDateTime();
		if($this->globalID == NULL)
			$this->globalID = GID::createGID($this->personalPublicKey, $this->salt);
		if(!GID::isValid($this->globalID))
			throw new SocialRecordFormatException('SocialRecord: Invalid globalID value [' . $this->globalID . ']');
			
		if($this->platformGID == NULL && $this->type == SocialRecord::TYPE_PLATFORM)
			$this->platformGID = $this->globalID;
		if($this->platformGID == NULL)
			throw new SocialRecordFormatException('SocialRecord: platformGID must be specified for instantiation');
		if(!GID::isValid($this->platformGID))
			throw new SocialRecordFormatException('SocialRecord: Invalid platformGID value [' . $this->platformGID . ']');
		
		if($this->keyRevocationList == NULL)
			$this->keyRevocationList = array();
		if($this->active == NULL)
			$this->active = 1;
		
		return new SocialRecord($this);
	}
1293320
public function jsonSerialize()
    {
        $linearrings = [];
        foreach ($this->linestrings as $linestring) {
            $linearrings[] = new \GeoJson\Geometry\LinearRing($linestring->jsonSerialize()->getCoordinates());
        }

        return new \GeoJson\Geometry\Polygon($linearrings);
    }
376840
protected function fillTravisCi()
    {
        if (isset($this->env['TRAVIS']) && $this->env['TRAVIS'] && isset($this->env['TRAVIS_JOB_ID'])) {
            $this->env['CI_JOB_ID'] = $this->env['TRAVIS_JOB_ID'];

            if ($this->config->hasServiceName()) {
                $this->env['CI_NAME'] = $this->config->getServiceName();
            } else {
                $this->env['CI_NAME'] = 'travis-ci';
            }

            // backup
            $this->readEnv['TRAVIS'] = $this->env['TRAVIS'];
            $this->readEnv['TRAVIS_JOB_ID'] = $this->env['TRAVIS_JOB_ID'];
            $this->readEnv['CI_NAME'] = $this->env['CI_NAME'];
        }

        return $this;
    }
1183005
protected function lexVariable(): VariableNode
    {
        $start = $this->lexer->getToken();

        $this->expect(TokenKindEnum::DOLLAR);

        return new VariableNode($this->lexName(), $this->createLocation($start));
    }
1153345
public function save() {
        $wt_tree = Globals::getTree();
        $tmp_contrl = new PageController();
        $tmp_contrl->restrictAccess(
            Auth::isManager($wt_tree) 
            && Filter::checkCsrf()
         );
        
        $ga_id          = Filter::postInteger('ga_id');
        $description    = Filter::post('description');
        $analysislevel  = Filter::postInteger('analysislevel');
        $use_map        = Filter::postBool('use_map');
        if($use_map) {
            $map_file   = base64_decode(Filter::post('map_file'));
            $map_top_level   = Filter::postInteger('map_top_level');
        }
        $use_flags      = Filter::postBool('use_flags');
        $gen_details    = Filter::postInteger('gen_details');
        
        $success = false; 
        if($ga_id) {
            $ga = $this->provider->getGeoAnalysis($ga_id, false);
            if($ga) {
                $ga->setTitle($description);
                $ga->setAnalysisLevel($analysislevel + 1);
                $options = $ga->getOptions();
                if($options) {
                    $options->setUsingFlags($use_flags);
                    $options->setMaxDetailsInGen($gen_details);
                    if($use_map) {
                        $options->setMap(new OutlineMap($map_file));
                        $options->setMapLevel($map_top_level + 1);
                    }
                    else {
                        $options->setMap(null);
                    }
                }
				
				$res = $this->provider->updateGeoAnalysis($ga);
				if($res) {
					FlashMessages::addMessage(I18N::translate('The geographical dispersion analysis “%s” has been successfully updated', $res->getTitle()), 'success');
					Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'.$res->getId().'” has been updated.');
					$ga = $res;
					$success = true;
				}
				else {
					FlashMessages::addMessage(I18N::translate('An error occured while updating the geographical dispersion analysis “%s”', $ga->getTitle()), 'danger');
					Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'. $ga->getId() .'” could not be updated. See error log.');
				}
            }
        } else {
			$ga = $this->provider->createGeoAnalysis(
				$description,
				$analysislevel + 1,
				$use_map ? $map_file : null,
				$use_map ? $map_top_level + 1 : null,
				$use_flags,
				$gen_details
			);
			if($ga) {
				FlashMessages::addMessage(I18N::translate('The geographical dispersion analysis “%s” has been successfully added.', $ga->getTitle()), 'success');
				Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'.$ga->getId().'” has been added.');
				$success = true;
			}
			else {
				FlashMessages::addMessage(I18N::translate('An error occured while adding the geographical dispersion analysis “%s”', $description), 'danger');
				Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis “'.$description.'” could not be added. See error log.');
			}
        }
        
        $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig&ged=' . $wt_tree->getNameUrl();
        if(!$success) {			
            if($ga) {
                $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@edit&ga_id='. $ga->getId() .'&ged=' . $wt_tree->getNameUrl();
            }
            else {
                $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@add&ged=' . $wt_tree->getNameUrl();
            }
        }        
        header('Location: ' . WT_BASE_URL . $redirection_url);
        
    }
581608
final public function to_record() {
        $data = new stdClass();
        $properties = static::properties_definition();
        foreach ($properties as $property => $definition) {
            $data->$property = $this->raw_get($property);
        }
        return $data;
    }
432098
public function build(): SetReturnValueRequest
	{
		$instance = new SetReturnValueRequest();
		if ($this->newValue === null) {
			throw new BuilderException('Property [newValue] is required.');
		}
		$instance->newValue = $this->newValue;
		return $instance;
	}
49185
public function toDatamapperObject()
    {
        // directly set private properties if entity extends the datamapper entity class (fast!)
        if (is_subclass_of($this->class, '\ProAI\Datamapper\Support\Entity')) {
            $class = $this->class;

            return $class::newFromEloquentObject($this);
        }

        // set private properties via reflection (slow!)
        $reflectionClass = new ReflectionClass($this->class);

        $entity = $reflectionClass->newInstanceWithoutConstructor();

        // attributes
        foreach ($this->mapping['attributes'] as $attribute => $column) {
            $this->setProperty(
                $reflectionClass,
                $entity,
                $attribute,
                $this->attributes[$column]
            );
        }

        // embeddeds
        foreach ($this->mapping['embeddeds'] as $name => $embedded) {
            $embeddedReflectionClass = new ReflectionClass($embedded['class']);

            $embeddedObject = $embeddedReflectionClass->newInstanceWithoutConstructor();
            foreach ($embedded['attributes'] as $attribute => $column) {
                // set property
                $this->setProperty(
                    $embeddedReflectionClass,
                    $embeddedObject,
                    $attribute,
                    $this->attributes[$column]
                );
            }

            $this->setProperty(
                $reflectionClass,
                $entity,
                $name,
                $embeddedObject
            );
        }

        // relations
        foreach ($this->mapping['relations'] as $name => $relation) {
            // set relation object
            if (! empty($this->relations[$name])) {
                $relationObject = $this->relations[$name]->toDatamapperObject();
            } elseif (in_array($relation['type'], $this->manyRelations)) {
                $relationObject = new ProxyCollection;
            } else {
                $relationObject = new Proxy;
            }
            
            // set property
            $this->setProperty(
                $reflectionClass,
                $entity,
                $name,
                $relationObject
            );
        }

        return $entity;
    }
1249630
public function build(): GetNodeForLocationRequest
	{
		$instance = new GetNodeForLocationRequest();
		if ($this->x === null) {
			throw new BuilderException('Property [x] is required.');
		}
		$instance->x = $this->x;
		if ($this->y === null) {
			throw new BuilderException('Property [y] is required.');
		}
		$instance->y = $this->y;
		$instance->includeUserAgentShadowDOM = $this->includeUserAgentShadowDOM;
		return $instance;
	}
21815
private function kinsta() {
		try {
			return $this->cleanResponse( RecordConverter::kinsta() );
		} catch ( \Exception $e ) {
			throw new GeotException( $e->getMessage() );
		}
	}
882890
public function prepareVars()
    {
        $this->vars['relationManageId'] = $this->manageId;
        $this->vars['relationLabel'] = $this->config->label ?: $this->field;
        $this->vars['relationManageTitle'] = $this->manageTitle;
        $this->vars['relationField'] = $this->field;
        $this->vars['relationType'] = $this->relationType;
        $this->vars['relationSearchWidget'] = $this->searchWidget;
        $this->vars['relationToolbarWidget'] = $this->toolbarWidget;
        $this->vars['relationManageMode'] = $this->manageMode;
        $this->vars['relationManageWidget'] = $this->manageWidget;
        $this->vars['relationToolbarButtons'] = $this->toolbarButtons;
        $this->vars['relationViewMode'] = $this->viewMode;
        $this->vars['relationViewWidget'] = $this->viewWidget;
        $this->vars['relationViewModel'] = $this->viewModel;
        $this->vars['relationPivotWidget'] = $this->pivotWidget;
        $this->vars['relationSessionKey'] = $this->relationGetSessionKey();
        $this->vars['relationExtraConfig'] = $this->extraConfig;
    }
518885
protected function generateSearchRecord()
    {
        $searchPage = CwpSearchPage::create();
        $searchPage->URLSegment = 'search';
        $searchPage->Title = _t('SilverStripe\\CMS\\Search\\SearchForm.SearchResults', 'Search Results');
        $searchPage->ID = -1;
        return $searchPage;
    }
1040545
public function createMapper()
    {
        if ($this->mapperElement !== null) {
            throw new BuildException(
                'Cannot define more than one mapper',
                $this->getLocation()
            );
        }
        $this->mapperElement = new Mapper($this->project);

        return $this->mapperElement;
    }