@inheritDoc

This override adds sanitation to the values and already combines some of
the values to retrieve  a Source object
11344
protected function setSubmittedValues()
    {
        parent::setSubmittedValues();

        // Get the targeted source.
        $this->setSubmittedSource();
        // Sanitise service: lowercase ascii characters, numbers, _ and -.
        $this->submittedValues['service'] = preg_replace('/[^a-z0-9_\-]/', '', $this->submittedValues['service']);
    }
608675
function handleResource( $tpl, &$resourceData, $method, &$extraParameters )
    {
        return $this->handleResourceData( $tpl, $this, $resourceData, $method, $extraParameters );
    }
91166
public function sanitize()
    {
        $value = filter_var($this->value, FILTER_SANITIZE_STRING);

        if (false === $value) {
            throw FailedToSanitize::fromValueForClass($this->value, static::class);
        }

        return $value;
    }
321708
public function getDirty($includeJson = false)
    {
        $dirty = parent::getDirty();

        if (!$includeJson) {
            return $dirty;
        }

        foreach (array_unique($this->jsonAttributes) as $attribute) {
            $originals[$attribute] = json_decode(array_get($this->original, $attribute, 'null'), true);
        }

        foreach ($this->jsonAttributes as $jsonAttribute => $jsonColumn) {
            if ($this->$jsonAttribute !== null &&
                $this->$jsonAttribute !== array_get($originals[$jsonColumn], $jsonAttribute)) {
                $dirty[$jsonAttribute] = json_encode($this->$jsonAttribute);
            }
        }

        return $dirty;
    }
262761
public function sanitize($value)
    {
        if(!$value instanceof KObjectConfigJson)
        {
            if(is_string($value)) {
                $value = $this->getObject('object.config.factory')->fromString('json', $value);
            } else {
                $value = $this->getObject('object.config.factory')->createFormat('json', $value);
            }
        }

        return $value;
    }
955453
protected function castValue($value, $source)
    {
        // Already cast
        if (is_object($value)) {
            return $value;
        }

        // Get provided or default cast
        $casting = empty($source['casting'])
            ? ViewableData::config()->uninherited('default_cast')
            : $source['casting'];

        return DBField::create_field($casting, $value);
    }
1211597
public function sanitize($value)
    {
        foreach($this->_queue as $filter) {
            $value = $filter->sanitize($value);
        }

        return $value;
    }
918689
protected function valueRetriever($value)
	{
		return function($item) use ($value)
		{
			return is_object($item) ? $item->{$value} : array_get($item, $value);
		};
	}
109588
function prependTo(iResourceStream $streamResource, $rwFlag = STREAM_FILTER_ALL)
    {
        $resource = $streamResource->getRHandler();
        $resource = stream_filter_prepend(
            $resource
            , $this->getLabel()
            , $rwFlag
            , \Poirot\Std\cast($this->optsData())->toArray()
        );

        return $resource;
    }
486793
function handleResource( $tpl, &$resourceData, $method, &$extraParameters )
    {
        $path = $resourceData['template-name'];

        $matchKeys = $this->Keys;
        if ( isset( $GLOBALS['eZDesignKeys'] ) )
        {
            $matchKeys = array_merge( $matchKeys, $GLOBALS['eZDesignKeys'] );
            unset( $GLOBALS['eZDesignKeys'] );
            $this->Keys = $matchKeys;
        }
        if ( is_array( $extraParameters ) and
             isset( $extraParameters['ezdesign:keys'] ) )
        {
            $this->mergeKeys( $matchKeys, $extraParameters['ezdesign:keys'] );
        }
        $this->KeyStack[] = $this->Keys;
        $this->Keys = $matchKeys;

        eZDebug::accumulatorStart( 'override_cache', 'Override', 'Cache load' );

        if( !isset( $GLOBALS['eZOverrideTemplateCacheMap'] ) )
        {
            $overrideCacheFile = $this->createOverrideCache();

            if ( $overrideCacheFile )
            {
                include_once( $overrideCacheFile );
            }
        }

        if ( isset( $GLOBALS['eZOverrideTemplateCacheMap'] ) )
        {
            if( isset( $GLOBALS['eZOverrideTemplateCacheMap'][md5( '/' . $path )] ) )
            {
                $cacheMap = $GLOBALS['eZOverrideTemplateCacheMap'][md5( '/' . $path )];
                if ( !is_string( $cacheMap ) and trim( $cacheMap['code'] ) )
                {
                    eval( "\$matchFile = " . $cacheMap['code'] . ";" );
                }
                else
                {
                    $matchFile = $cacheMap;
                }
                $match['file'] = $matchFile;
            }
        }
        else
        {
            $template = "/" . $path;
            $matchFileArray = eZTemplateDesignResource::overrideArray( $this->OverrideSiteAccess );

            $matchFile = $matchFileArray[$template];

            if ( isset( $matchFile['custom_match'] ) )
            {
                $matchFound = false;
                foreach ( $matchFile['custom_match'] as $customMatch )
                {
                    $matchOverride = true;
                    if ( count( $customMatch['conditions'] ) > 0 )
                    {
                        foreach ( array_keys( $customMatch['conditions'] ) as $conditionKey )
                        {
                            // Create special substring match for subtree override
                            if ( $conditionKey == 'url_alias' )
                            {
                                if ( strpos( $matchKeys['url_alias'], $customMatch['conditions'][$conditionKey] ) === 0 )
                                {
                                }
                                else
                                {
                                    $matchOverride = false;
                                }
                            }
                            else if ( isset( $matchKeys[$conditionKey] ) and
                                      isset( $customMatch['conditions'][$conditionKey] ) )
                            {
                                if ( is_array( $matchKeys[$conditionKey] ) )
                                {
                                    if ( !in_array( $customMatch['conditions'][$conditionKey], $matchKeys[$conditionKey] ) )
                                    {
                                        $matchOverride = false;
                                    }
                                }
                                else if ( $matchKeys[$conditionKey] != $customMatch['conditions'][$conditionKey] )
                                {
                                    $matchOverride = false;
                                }
                            }
                            else
                            {
                                $matchOverride = false;
                            }
                        }
                        if ( $matchOverride == true )
                        {
                            $match['file'] = $customMatch['match_file'];
                            $matchFound = true;
                            break;
                        }
                        else
                        {
                        }
                    }
                    else
                    {
                        // Default match without conditions
                        $match['file'] = $customMatch['match_file'];
                        $matchFound = true;
                    }
                }
                if ( !$matchFound )
                    $match['file'] = $matchFile['base_dir'] . $matchFile['template'];
            }
            else
            {
                $match['file'] = $matchFile['base_dir'] . $matchFile['template'];
            }
        }
        eZDebug::accumulatorStop( 'override_cache' );
        if ( isset( $match ) )
        {
            $file = $match["file"];

            $matchedKeys = array();
            $usedKeys = array();
            foreach ( $matchKeys as $matchKeyName => $matchKeyValue )
            {
                $usedKeys[$matchKeyName] = $matchKeyValue;
            }
            $extraParameters['ezdesign:used_keys'] = $usedKeys;
            $extraParameters['ezdesign:matched_keys'] = $matchedKeys;
            $tpl->setVariable( 'used', $usedKeys, 'DesignKeys' );
            $tpl->setVariable( 'matched', $matchedKeys, 'DesignKeys' );
            $resourceData['template-filename'] = $file;
            $result = eZTemplateFileResource::handleResourceData( $tpl, $this, $resourceData, $method, $extraParameters );
        }
        else
        {
            $result = false;
        }
        $this->Keys = array_pop( $this->KeyStack );
        return $result;
    }
104607
private function scrub($data, $filter = DEFAULT_FILTER, array $options = [])
    {
        //To filter a large array;
        if (is_array($data)) {
            $definedOptions = array_intersect_key($data, $options);
            if (count($data) == count($definedOptions)) {
                return $this->filterArray($data, $options);
            } else {
                $sanitized = [];
                foreach ($data as $key => $variable) {
                    $type = gettype($variable);

                    switch ($type) {
                        case "integer":
                            $sanitized[$key] = $this->int($variable);
                            break;
                        case "float":
                        case "double":
                            $sanitized[$key] = $this->float($variable);
                            break;
                        case "string":
                            $sanitized[$key] = $this->string($variable);
                            break;
                        case "object": //@TODO maybe serialize?,
                        case "resource":
                            //there is not much to be done with objects;
                            //maybe should come up with a way to check how safe they are;
                            $this->sanitized = true;
                            $sanitized[$key] = $variable;
                            break;
                        case "NULL":
                        case "unknown type":
                        default:
                            $sanitized[$key] = $this->filter($variable, static::FILTER_RAW, $options);
                            break;
                    }
                }

                return $sanitized;
            }
        }

        //bitwise disjunction of flags
        $options['flags'] = implode("|", $options['flags']);

        return $this->filter($data, $filter, $options);
    }
293228
public function sanitize($value)
    {
        $value = (string) $value;

        if (!empty($value)) {
            $value = JComponentHelper::filterText($value);
        }

        return $value;
    }
859502
protected function cleanUpValue( $value ) {
		$cleanValue = [];
		if ( !is_array( $value ) ) {
			return $cleanValue;
		}
		foreach ( $value as $singleValue ) {
			$singleValue = parent::cleanUpValue( $singleValue );
			// Remove options that we don't have here
			if ( !isset( $this->fields[ $singleValue ] ) ) {
				continue;
			}
			$cleanValue[] = $singleValue;
		}
		return $cleanValue;
	}
979327
public function sanitizeWithCallback($value)
    {
        if ($this->needsSanitization()) {
            return call_user_func(
                $this->getArgument('sanitize'),
                Descend::whileEmpty($value)
            );
        }

        return $value;
    }
317067
public function getValue($object)
    {
        $get = 'get'.ucfirst($this->property);
        $has = 'has'.ucfirst($this->property);
        $is = 'is'.ucfirst($this->property);

        if (method_exists($object, $get)) {
            return $object->$get();
        }

        if (method_exists($object, $has)) {
            return $object->$has();
        }

        if (method_exists($object, $is)) {
            return $object->$is();
        }

        throw DeserializerLogicException::createMissingMethod(get_class($object), [$get, $has, $is]);
    }
236081
protected function findByFilterComponentsSourceSetup( $source )
    {

        // Set source defaults
        if( !( $source & ( self::PERSISTED | self::UNPERSISTED ) ) ) {
            $source += self::PERSISTED + self::UNPERSISTED;
        }

        if( !( $source & ( self::CHANGED | self::UNCHANGED ) ) ) {
            $source += self::CHANGED + self::UNCHANGED;
        }

        if( !( $source & ( self::WITH_CHILDREN | self::NO_CHILDREN ) ) ) {
            $source += self::WITH_CHILDREN;
        }

        if( !( $source & ( Base::DATA | Base::INITIAL ) ) ) {
            $source += Base::DATA;
        }

        return $source;

    }
164745
static function fetchScriptsToPurge( $asObject = true, $offset = false, $limit = false )
    {
        $conditions = array( 'last_report_timestamp' => array( '<', time() - self::STATUS_PURGE_TIMEOUT ),
                             'progress' => 100 );

        $limitation = null;
        if ( $offset !== false or $limit !== false )
        {
            $limitation = array( 'offset' => $offset, 'length' => $limit );
        }

        return eZPersistentObject::fetchObjectList( eZScheduledScript::definition(),
                                                    null, $conditions, null, $limitation, $asObject );
    }