Neos\Media\Domain\Strategy\AssetModelMappingStrategyInterface::map PHP Method

map() public method

MUST always return a fully qualified class name for a media model. If you need to fallback to different strategies you need to implement a "ConjunctionStrategy", but in the end you have to return a final class name.
public map ( PersistentResource $resource, array $additionalProperties = [] ) : string
$resource Neos\Flow\ResourceManagement\PersistentResource
$additionalProperties array 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 the determined target class name
    public function map(PersistentResource $resource, array $additionalProperties = array());

Usage Example

 /**
  * Applies the model mapping strategy for a converted resource to determine the final target type.
  * The strategy is NOT applied if $source['__type'] is set (overriding was allowed then, otherwise an exception would have been thrown earlier).
  *
  * @param string $originalTargetType The original target type determined so far
  * @param PersistentResource $resource The resource that is to be converted to a media file.
  * @param array $source the original source properties for this type converter.
  * @return string Class name of the media model to use for the given resource
  */
 protected function applyModelMappingStrategy($originalTargetType, PersistentResource $resource, array $source = array())
 {
     $finalTargetType = $originalTargetType;
     if (!isset($source['__type'])) {
         $finalTargetType = $this->assetModelMappingStrategy->map($resource, $source);
     }
     return $finalTargetType;
 }
AssetModelMappingStrategyInterface