Construct base string on which the slug will be based.
@param Array $baseFields Basefield configuration (per field)
@param Array $data Submitted data
@return String
8916
protected function _getBaseString($baseField, $data) {
        $type = $baseField['type'];
        $method = '_getBaseStringFrom' . ucfirst($type);
        return $this->{$method}($data, $baseField);
    }
134220
public function basePath($basePath = null)
    {
        if (!func_num_args()) {
            return $this->_basePath;
        }
        $this->_basePathTmp = $basePath;
        if ($this->_ignorePath) {
            $basePath = preg_replace($this->_ignorePath, '', $basePath);
        }
        $this->_basePath = $basePath && $basePath !== '/' ? '/' . trim($basePath, '/') : '';
        return $this;
    }
526944
private function buildBaseString($baseURI, $method, $params)
    {
        $return = array();
        ksort($params);

        foreach($params as $key => $value)
        {
            $return[] = rawurlencode($key) . '=' . rawurlencode($value);
        }

        return $method . "&" . rawurlencode($baseURI) . '&' . rawurlencode(implode('&', $return));
    }
906807
private function composeFormInputs(array $data, $baseKey = '')
    {
        $result = [];
        foreach ($data as $key => $value) {
            if (!empty($baseKey)) {
                $key = $baseKey . '[' . $key . ']';
            }
            if (is_array($value)) {
                $result = array_merge($result, $this->composeFormInputs($value, $key));
            } else {
                $result[$key] = $value;
            }
        }
        return $result;
    }
36384
public static function queryByBaseId( $baseId, $config = [] ) {

		$type	= isset( $config[ 'type' ] ) ? $config[ 'type' ] : self::TYPE_COMMENT;
		$status	= isset( $config[ 'status' ] ) ? $config[ 'status' ] : self::STATUS_APPROVED;

		return self::find()->where( [ 'baseId' => $baseId, 'type' => $type, 'status' => $status ] );
	}
753040
public function beforeInsert(array &$args) {
        $model =  $args[0];
        $data  = &$args[1];

        $countBaseFields = count($this->_config['baseField']);
        $countSlugFields = count($this->_config['slugField']);

        // Scenario 1: one or more slugfields composed of a single basefield
        $method = '_addSlugFromSingle';
        if ($countBaseFields > 1 && $countSlugFields <= 1) {
            // Scenario 2: a single slug composed of multiple base fields
            $method = '_addSlugFromMultiple';
        }

        $referenceData = $data;

        // If the baseFields are not found in $data, and the model is multilingual,
        // we might be able to collect the baseField(s) from its primary language counterpart
        $hasLangColumn = !empty($data[Garp_Model_Behavior_Translatable::LANG_COLUMN]);
        $keys = array_keys($data);
        $baseColumns = $this->_baseFieldConfigToColumns($this->_config['baseField']);
        $intersect = array_intersect($baseColumns, $keys);

        if (count($intersect) != count($this->_config['baseField']) && $model->isMultilingual() && $hasLangColumn) {
            $this->_modifyReferenceDataForMultilingualModels($referenceData, $model);
        }

        $this->{$method}($model, $data, $referenceData);
    }
1338893
public function generate(array $data): string
    {
        /** @var RecordFinder $recordFinder */
        $recordFinder = GeneralUtility::makeInstance(RecordFinder::class);
        $uidOfStyleguideRootPage = $recordFinder->findPidOfMainTableRecord('tx_styleguide');
        $uidOfElementsBasicPage = $recordFinder->findPidOfMainTableRecord('tx_styleguide_elements_basic');
        $uidOfElementsGroupPage = $recordFinder->findPidOfMainTableRecord('tx_styleguide_elements_group');
        $result = [];
        // Don't add first page if not selectable
        if (!isset($data['fieldConfig']['config']['treeConfig']['appearance']['nonSelectableLevels'])) {
            $result[] = $uidOfStyleguideRootPage;
        }
        // Don't add sub pages if maxlevels is set
        if (!isset($data['fieldConfig']['config']['treeConfig']['appearance']['maxLevels'])
            || (isset($data['fieldConfig']['config']['treeConfig']['appearance']['maxLevels'])
                && $data['fieldConfig']['config']['treeConfig']['appearance']['maxLevels'] > 1)
        ) {
            $result[] = $uidOfElementsBasicPage;
            $result[] = $uidOfElementsGroupPage;
        }
        return implode(',', $result);
    }
235409
protected function baseUrl(array $config = [])
    {
        if (isset($this->baseUrl)) {
            return $this->baseUrl;
        }

        if (isset($config['base_url'])) {
            $this->baseUrl = $config['base_url'];
            return $this->baseUrl;
        }

        switch ($config['env']) {
            case self::ENV_DEVELOPMENT:
                $this->baseUrl = self::BASE_URL_DEVELOPMENT;
                break;

            case self::ENV_PRODUCTION:
                $this->baseUrl = self::BASE_URL_PRODUCTION;
                break;

            default:
                $message = sprintf(
                    'Unsupported environment "%s". Supported environments are "%s"',
                    $config['env'],
                    implode(', ', [self::ENV_DEVELOPMENT, self::ENV_PRODUCTION])
                );
                throw new \InvalidArgumentException($message);
        }

        return $this->baseUrl;
    }
180576
protected function _getBaseStringFromDate(array $data, array $baseField) {
        $col = $baseField['column'];
        $format = $baseField['format'] ?: 'd-m-Y';
        if (!array_key_exists($col, $data)) {
            return '';
        }
        return date($format, strtotime($data[$col]));
    }
390134
public static function baseType($fieldId)
    {
        //====================================================================//
        // Detect List Id Fields
        if (self::isListField($fieldId)) {
            $fieldId = self::fieldName($fieldId);
        }
        //====================================================================//
        // Detect Objects Id Fields
        if (self::isIdField((string) $fieldId)) {
            $fieldId = self::objectType((string) $fieldId);
        }

        return $fieldId;
    }
1044533
private function applyUrls(Siteroot $siteroot, array $data)
    {
        if (!array_key_exists('mappings', $data)) {
            // noting to save
            return $this;
        }

        $urlsData = $data['mappings'];

        foreach ($urlsData['created'] as $row) {
            $url = new Url();
            $url
                ->setSiteroot($siteroot)
                ->setDefault(!empty($row['default']))
                ->setGlobalDefault(!empty($row['global_default']))
                ->setHostname($row['hostname'])
                ->setLanguage($row['language'])
                ->setTarget($row['target']);

            $siteroot->addUrl($url);
        }

        foreach ($urlsData['modified'] as $row) {
            foreach ($siteroot->getUrls() as $url) {
                if ($url->getId() === $row['id']) {
                    $url
                        ->setSiteroot($siteroot)
                        ->setDefault(!empty($row['default']))
                        ->setGlobalDefault(!empty($row['global_default']))
                        ->setHostname($row['hostname'])
                        ->setLanguage($row['language'])
                        ->setTarget($row['target']);

                    break;
                }
            }
        }

        foreach ($urlsData['deleted'] as $id) {
            foreach ($siteroot->getUrls() as $url) {
                if ($url->getId() === $id) {
                    $siteroot->removeUrl($url);
                    break;
                }
            }
        }

        return $this;
    }
397002
public function generate(array $data): string
    {
        /** @var RecordFinder $recordFinder */
        $recordFinder = GeneralUtility::makeInstance(RecordFinder::class);
        return implode(',', $recordFinder->findUidsOfDemoBeUsers());
    }
851363
private function addBaseurl2AnchorUrls(&$filtered, $baseurl)
    {
        $textf   = $this->di->get("textfilter");
        $url     = $this->di->get("url");
        $request = $this->di->get("request");
        $part = $request->getRoute();

        // Use callback to url->create() instead of string concat
        $callback = function ($route) use ($url, $baseurl, $part) {
            if (!empty($route) && $route[0] == "!") {
                return $url->asset(substr($route, 1), $baseurl);
            }

            if (isset($route[0])
                && isset($route[1])
                && $route[0] === "."
                && $route[1] === "/"
            ) {
                return $url->create(
                    substr($route, 2),
                    $baseurl . $part
                );
            }

            return $url->create($route, $baseurl);
        };

        $filtered->text =
            $textf->addBaseurlToRelativeLinks($filtered->text, $baseurl, $callback);
    }
225343
protected static function mergeConfig($newData, &$baseConfig)
    {
        if (is_array($newData)) {
            foreach ($newData as $key => $value) {
                if (isset($baseConfig[$key])) {
                    self::mergeConfig($value, $baseConfig[$key]);
                } else {
                    $baseConfig[$key] = $value;
                }
            }
        } else {
            $baseConfig = $newData;
        }
    }
974464
public function withBasePath($basePath)
    {
        if (!is_string($basePath)) {
            throw new InvalidArgumentException('Uri path must be a string');
        }
        if (!empty($basePath)) {
            $basePath = '/' . trim($basePath, '/');
        }
        $clone = clone $this;

        if ($basePath !== '/') {
            $clone->basePath = Validator::checkPath($basePath);
        }

        return $clone;
    }
1308464
public function basePath(?string $basePath = null) {
        if ($basePath != null) {
            $this->basePath = $basePath;
        }
        return $this->basePath;
    }
1284355
public function buildBaseString($uri, array $parameters = [], $httpMethod = 'POST')
    {
        return $this->getBaseStringBuilder()->build($httpMethod, $uri, $parameters);
    }