Create a new redirect object from postvalues

@param $postValues
@return \stdClass
@throws \Exception
559409
public static function createRedirectFromPostValues($postValues)
    {
        if (isset($postValues['title'], $postValues['fromUrl'], $postValues['toUrl'])) {
            $redirectObject = new \stdClass();
            $redirectObject->title = $postValues['title'];
            $redirectObject->slug = StringUtil::slugify($postValues['title']);
            $redirectObject->fromUrl = $postValues['fromUrl'];
            $redirectObject->toUrl = $postValues['toUrl'];
            $redirectObject->type = $postValues['type'];

            return $redirectObject;
        } else {
            throw new \Exception('Trying to create valuelist with invalid data.');
        }
    }
998997
public function Validate($FormPostValues) {
      $this->Validation->ApplySchema($this->Data);
      // Validate the form posted values
      return $this->Validation->Validate($FormPostValues);
   }
588605
public function postProcessFormValues(array $formValues)
    {
        $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings, 'Neos.Flow.persistence.backendOptions.driver', $formValues['driver']);
        $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings, 'Neos.Flow.persistence.backendOptions.dbname', $formValues['dbname']);
        $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings, 'Neos.Flow.persistence.backendOptions.user', $formValues['user']);
        $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings, 'Neos.Flow.persistence.backendOptions.password', $formValues['password']);
        $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings, 'Neos.Flow.persistence.backendOptions.host', $formValues['host']);
        // Postgres natively supports multibyte-UTF8. It does not know utf8mb4, which is the default now
        if ($formValues['driver'] === 'pdo_pgsql') {
            $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings, 'Neos.Flow.persistence.backendOptions.charset', 'utf8');
        }
        $this->configurationSource->save(FLOW_PATH_CONFIGURATION . ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, $this->distributionSettings);

        $this->configurationManager->refreshConfiguration();

        $settings = $this->configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'Neos.Flow');
        $connectionSettings = $settings['persistence']['backendOptions'];
        try {
            $this->connectToDatabase($connectionSettings);
        } catch (\Exception $exception) {
            if (!$exception instanceof DBALException && !$exception instanceof \PDOException) {
                throw $exception;
            }
            try {
                $this->createDatabase($connectionSettings, $formValues['dbname']);
            } catch (DBALException $exception) {
                throw new SetupException(sprintf('Database "%s" could not be created. Please check the permissions for user "%s". DBAL Exception: "%s"', $formValues['dbname'], $formValues['user'], $exception->getMessage()), 1351000841, $exception);
            } catch (\PDOException $exception) {
                throw new SetupException(sprintf('Database "%s" could not be created. Please check the permissions for user "%s". PDO Exception: "%s"', $formValues['dbname'], $formValues['user'], $exception->getMessage()), 1346758663, $exception);
            }
            try {
                $this->connectToDatabase($connectionSettings);
            } catch (DBALException $exception) {
                throw new SetupException(sprintf('Could not connect to database "%s". Please check the permissions for user "%s". DBAL Exception: "%s"', $formValues['dbname'], $formValues['user'], $exception->getMessage()), 1351000864);
            } catch (\PDOException $exception) {
                throw new SetupException(sprintf('Could not connect to database "%s". Please check the permissions for user "%s". PDO Exception: "%s"', $formValues['dbname'], $formValues['user'], $exception->getMessage()), 1346758737);
            }
        }

        $migrationExecuted = Scripts::executeCommand('neos.flow:doctrine:migrate', $settings, false);
        if ($migrationExecuted !== true) {
            throw new SetupException(sprintf('Could not execute database migrations. Please check the permissions for user "%s" and execute "./flow neos.flow:doctrine:migrate" manually.', $formValues['user']), 1346759486);
        }

        $this->resetPolicyRolesCacheAfterDatabaseChanges();
    }
1357522
private function checkIfRequestIsValidOrThrowException($invalidValues)
    {
        if (!empty($invalidValues)) {
            $exception = new InvalidRequestException('Errors occurred while parsing the request');
            $exception->setErrors($invalidValues);
            throw $exception;
        }
    }
218675
public function saveUser($slug, $postValues)
    {
        $userObj = UserFactory::createUserFromPostValues($postValues);
        if ($userObj->slug != $slug) {
            // If the username changed, check for duplicates
            $doesItExist = $this->getUserBySlug($userObj->slug);
            if (!empty($doesItExist)) {
                throw new \Exception('Trying to rename user to existing username');
            }
        }
        $users = $this->getUsers();
        foreach ($users as $key => $user) {
            if ($user->slug == $slug) {
                $users[$key] = $userObj;
            }
        }
        $this->repository->users = $users;
        $this->save();
    }
197413
public function reschedCalendarEvent($postValues)
	{
	    $responseData = array();
	    
	    $calendarTable = $this->getServiceLocator()->get('MelisCalendarTable');
	    
	    $melisCoreAuth = $this->getServiceLocator()->get('MelisCoreAuth');
	    $userAuthDatas =  $melisCoreAuth->getStorage()->read();
	    $userId = (int) $userAuthDatas->usr_id;
	    
	    $resultEvent = $calendarTable->getEntryById($postValues['cal_id']);
	     
	    if (!empty($resultEvent)){
	         
	        $event = $resultEvent->current();
	         
	        if (!empty($event)){
	            if ($postValues['cal_date_end']==''){
	                $postValues['cal_date_end'] = $postValues['cal_date_start'];
	            }
	            $postValues['cal_last_update_by'] = $userId;
	            $postValues['cal_date_last_update'] = date('Y-m-d H:i:s');
	            $calendarTable->save($postValues,$postValues['cal_id']);
	            $responseData['success'] = 1;
	        }
	    }
	    
	    return $responseData;
	}
424678
public function andReturnValues(array $returnValues)
    {
        $this->andReturn(function() use (&$returnValues) {
            if (count($returnValues) > 1) {
                return array_shift($returnValues);
            } else {
                return current($returnValues);
            }
        });
        
        return $this;
    }
180828
public function exportValue(&$submitvalues, $assoc = false) {
        $valuearray = array();
        foreach ($this->_elements as $element) {
            $thisexport = $element->exportValue($submitvalues[$this->getName()], true);
            if ($thisexport != null) {
                $valuearray += $thisexport;
            }
        }
        if (empty($valuearray['customize'])) {
            return $this->_prepareValue(false, $assoc);
        }
        return array_key_exists('value', $valuearray) ? $this->_prepareValue($valuearray['value'], $assoc) : [];
    }
625170
public function deleteCalendarEvent($postValues)
	{
	    $calId = null;
	    $calendarTable = $this->getServiceLocator()->get('MelisCalendarTable');
	    $resultEvent = $calendarTable->getEntryById($postValues['cal_id']);
	     
	    if (!empty($resultEvent)){
	         
	        $event = $resultEvent->current();
	         
	        if (!empty($event)){
	            $calId = $calendarTable->deleteById($postValues['cal_id']);
	        }
	    }
	    
	    return $calId;
	}
1174711
public function getRedirectData()
    {
        // Build the post data as expected by Postfinance.
        $params = $this->getData();
        $postData = array();
        foreach ($params as $key => $value) {
            $postData[$key] = $value;
        }

        $postData['SHASIGN'] = Helper::createShaHash(
            $postData,
            $this->getRequest()->getShaIn(),
            $this->getRequest()->getHashingMethod()
        );

        return $postData;
    }
88334
private function transformPostValues(array $postValues): string
    {
        $body = '';
        foreach ($postValues as $key => $value) {
            $body .= urlencode($key) . '=' . urlencode($value) . '&';
        }

        return $body;
    }
517453
protected function saveAdvProperty($propertyValues)
    {
        // might break using hard
        $range = array();
        foreach($propertyValues as $key => $value){
            if(is_array($value)){
                // set the range
                foreach($value as $v){
                    $range[] = $this->getClass(tao_helpers_Uri::decode($v));
                }
            }
            else{
                $values[tao_helpers_Uri::decode($key)] = tao_helpers_Uri::decode($value);
            }

        }
        //if label is empty
        $validator = new tao_helpers_form_validators_NotEmpty(array('message' => __('Property\'s label field is required')));
        if(!$validator->evaluate($values[OntologyRdfs::RDFS_LABEL])){
            throw new Exception($validator->getMessage());
        }

        $property = $this->getProperty($values['uri']);
        unset($values['uri']);
        $property->removePropertyValues($this->getProperty(OntologyRdfs::RDFS_RANGE));
        if(!empty($range)){
            foreach($range as $r){
                $property->setRange($r);
            }
        }
        $this->bindProperties($property, $values);
    }
492091
public function insert($fieldsValues)
    {
        $this->connectToDB();
        $this->queryBuilder->table($this->table());
        return $this->queryBuilder->insert($fieldsValues);
    }
215589
public function SaveAdminUser($FormPostValues) {
      $UserID = 0;

      // Add & apply any extra validation rules:
      $Name = GetValue('Name', $FormPostValues, '');
      $FormPostValues['Email'] = GetValue('Email', $FormPostValues, strtolower($Name.'@'.Gdn_Url::Host()));
      $FormPostValues['ShowEmail'] = '0';
      $FormPostValues['TermsOfService'] = '1';
      $FormPostValues['DateOfBirth'] = '1975-09-16';
      $FormPostValues['DateLastActive'] = Gdn_Format::ToDateTime();
      $FormPostValues['DateUpdated'] = Gdn_Format::ToDateTime();
      $FormPostValues['Gender'] = 'u';
      $FormPostValues['Admin'] = '1';

      $this->AddInsertFields($FormPostValues);

      if ($this->Validate($FormPostValues, TRUE) === TRUE) {
         $Fields = $this->Validation->ValidationFields(); // All fields on the form that need to be validated (including non-schema field rules defined above)
         $Username = GetValue('Name', $Fields);
         $Email = GetValue('Email', $Fields);
         $Fields = $this->Validation->SchemaValidationFields(); // Only fields that are present in the schema
         
         // Insert the new user
         $UserID = $this->_Insert($Fields, array('NoConfirmEmail' => TRUE));
         
         if ($UserID) {
            $ActivityModel = new ActivityModel();
            $ActivityModel->Save(array(
               'ActivityUserID' => $UserID,
               'ActivityType' => 'Registration',
               'HeadlineFormat' => T('HeadlineFormat.Registration', '{ActivityUserID,You} joined.'),
               'Story' => T('Welcome Aboard!')
               ),
               FALSE,
               array('GroupBy' => 'ActivityTypeID'));
         }
         
         $this->SaveRoles($UserID, array(16), FALSE);
      }
      return $UserID;
   }
1033996
public function createFromCurrent($configurationValues)
    {
        $currentConfigurationValues = [
            self::CONFIG_KEY_CONTENT_TYPE_WEB_RESOURCE_MAP => $this->getContentTypeWebResourceMap(),
            self::CONFIG_ALLOW_UNKNOWN_RESOURCE_TYPES => $this->getAllowUnknownResourceTypes(),
            self::CONFIG_RETRY_WITH_URL_ENCODING_DISABLED => $this->getRetryWithUrlEncodingDisabled(),
            self::CONFIG_KEY_HTTP_CLIENT => $this->getHttpClient(),
        ];

        return new Configuration(array_merge($currentConfigurationValues, $configurationValues));
    }
836222
public function saveImageSet($slug, $postValues)
    {
        $imageSetObject = ImageSetFactory::createImageSetFromPostValues($postValues);

        $imageSet = $this->repository->imageSet;
        foreach ($imageSet as $key => $set) {
            if ($set->slug == $slug) {
                $imageSet[$key] = $imageSetObject;
            }
        }
        $this->repository->imageSet = $imageSet;
        $this->save();
    }
891790
public function exportValue(&$submitValues, $assoc = false) {
        if (!$this->is_tagging_enabled()) {
            return $this->_prepareValue([], $assoc);
        }
        if ($this->_findValue($submitValues) === '_qf__force_multiselect_submission') {
            // Nothing was selected.
            return $this->_prepareValue([], $assoc);
        }

        return parent::exportValue($submitValues, $assoc);
    }