Sulu\Bundle\MediaBundle\Media\FormatManager\FormatManager::getFormatDefinition PHP Method

getFormatDefinition() public method

public getFormatDefinition ( $formatKey, $locale = null, array $formatOptions = [] )
$formatOptions array
    public function getFormatDefinition($formatKey, $locale = null, array $formatOptions = [])
    {
        if (!isset($this->formats[$formatKey])) {
            throw new FormatNotFoundException($formatKey);
        }
        $format = $this->formats[$formatKey];
        $title = $format['key'];
        if (array_key_exists($locale, $format['meta']['title'])) {
            $title = $format['meta']['title'][$locale];
        } elseif (count($format['meta']['title']) > 0) {
            $title = array_values($format['meta']['title'])[0];
        }
        $formatArray = ['key' => $format['key'], 'title' => $title, 'scale' => $format['scale'], 'options' => !empty($formatOptions) ? $formatOptions : null];
        return $formatArray;
    }