Get an activity format override key.

@param  string $format     The activity format.
@param  array  $parameters Associative array containing parameters.
@return string The activity format override key.
487925
protected function _getOverrideKey($format, $parameters = array())
    {
        $result = $format;

        foreach ($parameters as $key => $value) {
            $result = str_replace(sprintf('{%s}', $key), $value, $result);
        }

        return $result;
    }
1255647
public static function getOutputFormatter( $format )
    {
        if ( !self::isRegisteredFormatter( $format ) )
        {
            $format = eZINI::instance( 'template.ini' )->variable( 'AttributeOperator', 'DefaultFormatter' );
        }

        if ( !( self::$formatter instanceof ezpAttributeOperatorFormatterInterface ) || $format != self::$format )
        {
            self::$formatter = self::createFormatter( $format );
            self::$format = $format;
        }

        return self::$formatter;
    }
2014
public function getProvider($arguments = [], $format = null)
    {
        $options = $this->getOptions($format)->setArguments($arguments);

        return $this->request->send($options);
    }
1312634
public function format($format = null)
    {
        if (empty($format)) {
            $format = $this->defaultFormat;
        }
        return $this->formatDatetimeObject($format);
    }
1246538
private function getJsonApiCacheKey(?string $format, array $context)
    {
        try {
            return md5($format.serialize($context));
        } catch (\Exception $exception) {
            // The context cannot be serialized, skip the cache
            return false;
        }
    }
415081
public function getAvailableActions($format)
    {
        $availables = [];

        foreach (array_filter($this->actions, function ($action) use ($format) {
            return $action->supports($format);
        }) as $action) {
            $schema = $action->getAction();
            $availables[$schema[0]][$schema[1]] = $this->explainAction($this->getActionName($action), $format);
        }

        return $availables;
    }
1297136
protected function getDateTimeFormat($parameters) {
        $format          = 'Y-m-d H:i:s';
        $parametersCount = count($parameters);
        if ($parametersCount > $this->amountOfParameters) {
            $format = $parameters[$parametersCount - 1];
        }
        return $format;
    }
18960
public function formatParameters(array $parameters, $keyString = null, $nested = false)
    {
        foreach ($parameters as $key => $value) {
            if (null !== $keyString && true === $nested) {
                $keyString = sprintf('%s[%s]', $keyString, $key);
            } else {
                $keyString = $key;
            }

            if (is_array($value)) {
                $this->formatParameters($value, $keyString, true);

                continue;
            } else {
                $this->formatedParameters[$keyString] = $value;
            }
        }

        return $this->formatedParameters;
    }
177096
public function getFormattedImage($format)
    {
        $formatName = $format instanceof FormatInterface
            ? $format->getName()
            : $format
        ;

        return $this->formattedImages
            ->filter(function (FormattedImageInterface $formattedImage) use ($formatName) {
                return ($format = $formattedImage->getFormat())
                    && $format->getName() == $formatName
                ;
            })
            ->first() ?: null // first() returns "false" if collection empty
        ;
    }
1094954
public function toString(string $format = null) : string
    {
        $operations = $this->operations;
        $operations[] = [ 'getImage', [ $format ] ];
        
        $driver = $this->getDriver();
        return array_reduce($operations, function ($carry, $item) use ($driver) {
            return $driver->{$item[0]}(...$item[1]);
        });
    }
466522
protected function applyCustomFormat($format, $data)
    {
        $aClassFunc = $this->getFuncParams($format);

        $params = array_key_exists(
            'params',
            $format
        ) ? $format['params'] : [];

        array_unshift($params, $data);

        $object = (new \ReflectionClass($aClassFunc['class']))->newInstance();

        $data = call_user_func_array([$object, $aClassFunc['method']], $params);

        return $data;
    }
171556
public static function getFormatClass($format)
    {
        // Return a namespace in a given format
        $class = sprintf('%s\Format\%sFormat', __NAMESPACE__, ucfirst(strtolower($format)));

        if (!class_exists($class)) {
            throw new \DomainException(
                sprintf(
                    'Structure format: %s not supported. Class: %s not found.',
                    $format,
                    $class
                )
            );
        }

        return $class;
    }
535962
public function format($format)
    {
        $format = preg_replace_callback('/(?<!\\\\)[DlFM]/', array($this, '_translate'), $format);
        return $this->_date->format($format);
    }
1310635
public function path($media, $format)
    {
        if (!$media) {
            return '';
        }

        $provider = $this->getProvider($media);

        $format = $provider->getFormatName($media, $format);

        return $provider->generatePublicUrl($media, $format);
    }
168711
public function write($format = 'rtf')
	{
		$string = '';
		
		// if $format is a string
		if (is_string($format)) {
			$writer = new Writer();
			$string = $writer->write($this->root, $format);	
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, format, to be a string"
			);
		}
		
		return $string;
	}
180177
public function getProcuredAt($format = 'Y-m-d')
    {
        if ($this->procuredAt instanceof \DateTime && $format !== null) {
            return $this->procuredAt->format($format);
        }

        return $this->procuredAt;
    }
429476
public function getEncoder($format)
    {
        if (!$this->supports($format)) {
            throw new \InvalidArgumentException(sprintf("Format '%s' is not supported by ContainerDecoderProvider.", $format));
        }

        return $this->container->get($this->encoders[$format]);
    }