FormEncoderBuilder
in package
implements
BuilderInterface
Class FormEncoderBuilder
Tags
Table of Contents
Interfaces
- BuilderInterface
- Interface BuilderInterface
Methods
- __construct() : mixed
- FormEncoderBuilder constructor.
- build() : mixed
- Builds FormEncoder.
- setCache() : FormEncoderBuilder
- Sets cache implementation.
- setCacheDir() : FormEncoderBuilder
- Sets cache directory.
- setSerializer() : FormEncoderBuilder
- Sets serializer implementation.
Methods
__construct()
FormEncoderBuilder constructor.
public
__construct() : mixed
build()
Builds FormEncoder.
public
build() : mixed
Note: Cache won't be set into provided serializer instance. It only works for instance built by this builder. You must manually inject the proper cache into the custom JMS Serializer instance.
Tags
setCache()
Sets cache implementation.
public
setCache(CacheItemPoolInterface $cache) : FormEncoderBuilder
This cache implementation will be used by FormEncoder component and underlying serializer to store
annotations cache. Any cache from symfony/cache
should work just fine.
Parameters
- $cache : CacheItemPoolInterface
Return values
FormEncoderBuildersetCacheDir()
Sets cache directory.
public
setCacheDir(string $cacheDir) : FormEncoderBuilder
This directory will be used by FormEncoder component and underlying serializer to store annotations cache. Annotations parsing consumes a lot of resources, which is the reason why you should cache results.
Parameters
- $cacheDir : string
Return values
FormEncoderBuildersetSerializer()
Sets serializer implementation.
public
setSerializer(SerializerInterface $serializer) : FormEncoderBuilder
This serializer implementation will be used by FormEncoder component.
Parameters
- $serializer : SerializerInterface