Adjust the alias of the page.

@param string                $value
@param \Contao\DataContainer $dc

@throws \Exception

@return string
964569
public function adjustAlias($value, $dc)
    {
        // Nothing to adjust if no folderUrls
        if (!Config::get('folderUrl')) {
            return $value;
        }

        // If current page is of type folder, update children
        if ($dc->activeRecord && $dc->activeRecord->type === 'folder') {
            $childRecords = Database::getInstance()->getChildRecords([$dc->id], 'tl_page');
            $this->updateChildren($childRecords);

            return $value;
        }

        $tl_page = new \tl_page();

        // Clean the alias
        $value = $this->cleanAlias($value);

        try {
            $value = $tl_page->generateAlias($value, $dc);
        } catch (\Exception $e) {
            // The alias already exists so add ID just like the original method would
            $value = $value.'-'.$dc->id;

            // Validate the alias once again and throw an error if it exists
            $value = $tl_page->generateAlias($value, $dc);
        }

        return $value;
    }
1189801
public function setCoreFriendlyAliasWordDelimiters($value)
    {
        $this->setFieldName('friendly_alias_word_delimiters');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
1362571
public function aliasSet( $value )
	{
		$columns = $this->getColumns();
		$this->aliasGet( $oldValue );
		foreach( $columns as &$column )
		{
			$tableAlias = $column[0];
			if( $tableAlias === $oldValue )
			{
				$column[0] = $value;
			}
		}

		$select = $this->getSelect();
		$from = $select->getPart( Zend_Db_Select::FROM );
		$select->reset( Zend_Db_Select::FROM );
		foreach( $from as $tableAlias => $descriptor )
		{
			if( $tableAlias === $oldValue )
			{
				unset($from[$oldValue]);
				$from[$value] = $descriptor;
			}
		}
		$select->from( array( $value => $this->getTable() ), array() );

		return $this
			->setAlias( $value )
			->resetColumns( $columns )
		;
	}
1025550
public function setCharacter($value)
    {
        if ($value !== self::CHARACTER_DEFAULT &&
           $value !== self::CHARACTER_KANSAI &&
           $value !== self::CHARACTER_BABY) {
            throw new DomainError('Invalid character');
        }
        $this->parameters['t'] = $value;
        return $this;
    }
179248
public function setPolicy($value)
    {
        if (!in_array($value, self::policies(), true)) {
            throw new DomainException(sprintf(self::MSG_UNEXPECTED_POLICY, implode(', ', self::policies())));
        }

        return $this->setAttribute('policy', $value);
    }
473833
protected function adjustValue($value)
    {
        if (preg_match('#^\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}$#', $value, $matches)) {
            $value .= ':00';
        } elseif (preg_match('#^\d{4}-\d{2}-\d{2}$#', $value, $matches)) {
            $value .= ' 00:00:00';
        }

        return $value;
    }
1022554
public function valueToWidget($value)
    {
        if (!\in_array($this->fieldType, ['radio', 'checkbox'])) {
            throw new \RuntimeException('Unknown field type encountered: ' . $this->fieldType);
        }

        if (null === $value) {
            return '';
        }

        return ('radio' === $this->fieldType) ? $value : \implode(',', $value);
    }
588030
public function setCoreFriendlyAliasTranslitClass($value)
    {
        $this->setFieldName('friendly_alias_translit_class');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
210683
protected function create_dc_node($name, $value = '')
    {
        if (empty($value)) {
            return;
        }
        $this->addChild($this->working_node, "dc:".$name, utf8_encode($value));
    }
51409
public function setDefaultType($value, $dc)
	{
		if (!$value)
		{
			if ($dc->activeRecord !== null)
			{
				$ptable =  $dc->activeRecord->ptable;
				$pid = $dc->activeRecord->pid;
			}
			else
			{
				return $value;
			}
			
			// Try to find content block elements for the theme
			$objLayout = \LayoutModel::findById(\Agoat\CustomContentElementsBundle\Contao\Controller::getLayoutId($ptable, $pid));	
			$objDefault = \ElementsModel::findDefaultPublishedElementByPid($objLayout->pid);
			
			// if no default content element is found 
			if ($objDefault === null)
			{
				if (\Config::get('hideLegacyCTE'))
				{
					$objDefault = \ElementsModel::findFirstPublishedElementByPid($objLayout->pid);
				}
				
				if ($objDefault === null)
				{
					$objDefault = new \stdClass();
					$objDefault->alias = 'text';
				}
			}

			$objContent = \ContentModel::findByPk($dc->id);

			$objContent->type = $objDefault->alias;
			$objContent->save();
				
			$this->redirect(\Environment::get('request'));
		}
	
		return $value;
	}
91137
public function setCoreFriendlyAliasWordDelimiter($value)
    {
        $this->setFieldName('friendly_alias_word_delimiter');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
686473
protected function id2alias($value)
    {
        $functionary = $this->functionaryRepository->findByID($value);

        $alias = $functionary->getLastName() . self::SEPARATOR_OFFSET . $functionary->getFirstName() . self::SEPARATOR_OFFSET . dechex(intval($functionary->getID()));

        return $this->cleanUrl($alias);
    }
1024583
public function setValue($value)
    {
        $matches = $this->parseKeywordText($value);
        if(isset($matches['keywords']))
        {
            if(isset($matches['keywords'][0]))
            {
                $this->database = $matches['keywords'][0];
            }
            $this->alias = $matches['alias'];
        }
    }
403440
protected function formatValue($format, $value)
    {
        switch ($format) {
            case 'dash':
                return $this->inflector->dasherize($value);
            case 'underscore':
                return $this->inflector->underscore($value);
            case 'studlycaps':
                return $this->inflector->studlify($value);
            case 'camelcase':
                return $this->inflector->camelize($value);
            default:
                throw new RuntimeException('Unable to format value');
        }
    }
1013787
protected function addValue($value)
    {
        $name                = 'where' . $this->whereContainer->getBindingCount();
        $this->values[$name] = $value;

        return ':' . $name;
    }
963877
public static function setAlias(string $alias, string $value)
    {
        self::getInstance()->setAlias($alias, $value);
    }
600969
public function setReasonCode($value)
    {
        $allowedReasonCodes = self::allowedReasonCodes();

        if (!in_array($value, $allowedReasonCodes, true)) {
            throw new DomainException(sprintf(self::MSG_UNEXPECTED_REASON_CODE, implode(', ', $allowedReasonCodes)));
        }

        return $this->setAttribute('reasonCode', $value);
    }