    import CacheRepository from 'pvbid-sdk/src/repositories/CacheRepository.js'

public class | source

# CacheRepository

#### Extends:

BaseRepository → CacheRepository

#### Direct Subclass:

ProjectStatusRepository, TagRepository

## Constructor Summary

Public Constructor
public | constructor(endpoint: string, singleMap: string, multiMap: string) Creates an instance of BaseRepository. |

## Member Summary

Public Members
public | params: {} |

## Method Summary

Public Methods
public | async create(entity: BidEntity): Promise<BidEntity> Creates a single entity and invalidates the cached data |
public | async delete(id: number): Promise<object> Deletes resource and removes resource from cache. |
public | async findById(id: int, forceReload: boolean): * Retrieves a single domain object by its id. |
public | async get(params: object, forceReload: boolean): * Retrieves an array of results for the endpoint |
public | async save(entity: BidEntity): Promise<BidEntity> Saves resource and stores response to cache by resource id. |

## Inherited Summary

From class BaseRepository
public | endpoint: * |
public | http: * |
public | httpConfig: * |
public | map: {"single": *, "multi": *} |
public | metaData: * |
public | params: {} |
public | async create(entity: BidEntity): Promise<BidEntity> Persists a new entity |
public | async delete(id: number): Promise<Object> Deletes a single entity by its id |
public | async findById(id: number): Promise<BidEntity> Retrieves a single domain object by its id. |
public | async get(params: Object): Promise<BidEntity[]> Retrieves an array of results for the endpoint |
public | async save(entity: BidEntity): Promise<BidEntity> Persists an update to the entity |

## Public Constructors

### public constructor(endpoint: string, singleMap: string, multiMap: string) source

Creates an instance of BaseRepository.

#### Override:

BaseRepository#constructor

#### Params:

Name | Type | Attribute | Description
endpoint | string |  |
singleMap | string |  |
multiMap | string |  |

## Public Members

### public params: {} source

#### Override:

BaseRepository#params

## Public Methods

### public async create(entity: BidEntity): Promise<BidEntity> source

Creates a single entity and invalidates the cached data

#### Override:

BaseRepository#create

#### Params:

Name | Type | Attribute | Description
entity | BidEntity |  | bid entity data object

#### Return:

Promise<BidEntity>

### public async delete(id: number): Promise<object> source

Deletes resource and removes resource from cache.

#### Override:

BaseRepository#delete

#### Params:

Name | Type | Attribute | Description
id | number |  | The id of the resource to delete

#### Return:

Promise<object> | Returns the response data.

### public async findById(id: int, forceReload: boolean): * source

Retrieves a single domain object by its id.

#### Override:

BaseRepository#findById

#### Params:

Name | Type | Attribute | Description
id | int |  | The id of the entity to retrieve.
forceReload | boolean |  | Flags repository to force reload skipping cached data.

#### Return:

*

### public async get(params: object, forceReload: boolean): * source

Retrieves an array of results for the endpoint

#### Override:

BaseRepository#get

#### Params:

Name | Type | Attribute | Description
params | object |  | A set of parameters to include for the endpoint.
forceReload | boolean |  | Flags repository to force reload skipping cached data.

#### Return:

*

### public async save(entity: BidEntity): Promise<BidEntity> source

Saves resource and stores response to cache by resource id.

#### Override:

BaseRepository#save

#### Params:

Name | Type | Attribute | Description
entity | BidEntity |  | bid entity data object

#### Return:

Promise<BidEntity>