class MultiFileJsonStorage implements ParsedDataPersistentStorageProvider (View source)

Multi-file JSON storage that splits entities by type into separate files.

Improves performance by allowing selective loading of entity types.

Methods

__construct(string $basePathToJsonFile, EntitySerializerInterface $serializer, bool $loadExisting = true, PhpDocStorage|null $phpDocStorage = null)

No description

array
getEntities()

No description

void
addEntity(mixed $entity)

No description

void
save()

Save entities to persistent storage

void
load()

Load entities from persistent storage

array
getEntitiesByType(string $fileId)

Get entities of a specific type without loading all files

bool
isTypeLoaded(string $fileId)

Check if an entity type file has been loaded

Details

__construct(string $basePathToJsonFile, EntitySerializerInterface $serializer, bool $loadExisting = true, PhpDocStorage|null $phpDocStorage = null)

No description

Parameters

string $basePathToJsonFile

Base path (e.g., "cache/Stubs.json")

EntitySerializerInterface $serializer

Serializer to use

bool $loadExisting

Whether to load existing files

PhpDocStorage|null $phpDocStorage

Optional PhpDoc storage

array getEntities()

No description

Return Value

array

void addEntity(mixed $entity)

No description

Parameters

mixed $entity

Return Value

void

void save()

Save entities to persistent storage

Return Value

void

void load()

Load entities from persistent storage

Return Value

void

array getEntitiesByType(string $fileId)

Get entities of a specific type without loading all files

Parameters

string $fileId

One of EntityTypeFileRouter::FILE_* constants

Return Value

array

bool isTypeLoaded(string $fileId)

Check if an entity type file has been loaded

Parameters

string $fileId

Return Value

bool