Neos.Media/Classes/Domain/Strategy/ConfigurationAssetModelMappingStrategy.php
public function map(PersistentResource $resource, array $additionalProperties = [])
    {
        $mediaType = MediaTypes::getMediaTypeFromFilename($resource->getFilename());
        foreach ($this->settings['patterns'] as $pattern => $mappingInformation) {
            if (preg_match($pattern, $mediaType)) {
                return $mappingInformation['className'];
            }
        }

        return $this->settings['default'];
    }
public function map(PersistentResource $resource, array $additionalProperties = [])
    {
        $mediaType = MediaTypes::getMediaTypeFromFilename($resource->getFilename());
        foreach ($this->settings['patterns'] as $pattern => $mappingInformation) {
            if (preg_match($pattern, $mediaType)) {
                return $mappingInformation['className'];
            }
        }

        return $this->settings['default'];
    }
public function map ( PersistentResource $ resource , array $ additionalProperties = [ ] ) { $ mediaType = MediaTypes :: getMediaTypeFromFilename ( $ resource -> getFilename ( ) ) ; foreach ( $ this -> settings [ 'patterns' ] as $ pattern => $ mappingInformation ) { if ( preg_match ( $ pattern , $ mediaType ) ) { return $ mappingInformation [ 'className' ] ; } } return $ this -> settings [ 'default' ] ; }
Map the given resource to a media model class.

@param PersistentResource $resource
@param array $additionalProperties Optional properties that can be taken into account for deciding the model class. what you get here can depend on the caller, so you should always fallback to something based on the resource.
@return string
Map the given resource to a media model class .