API Docs for:
Show:

MemoryResource Class

sync memory storage, implements ResourceClientInterface

Methods

count

() Number

Count all registered data

Returns:

Number:

total

create

(
  • data
)
Object public

Create new instance of Model class, saved in database

Parameters:

  • data Object

Returns:

Object:

destroyById

(
  • data
)
public

Destroy model instance

Parameters:

  • data Object

destroyById

(
  • id
)
public

Destroy model instance with the specified ID.

Parameters:

  • id String

find

(
  • filter
)
Array(Object) public

Find all model instances that match filter specification.

Parameters:

  • filter Object

Returns:

Array(Object):

findById

(
  • id
)
Object public

Find object by ID.

Parameters:

  • id String

Returns:

Object:

findOne

(
  • filter
)
Object public

Find one model instance that matches filter specification. Same as find, but limited to one result

Parameters:

  • filter Object

Returns:

Object:

generateId

(
  • data
)
String public

Generate id

Parameters:

  • data Object

Returns:

String:

toPlainObject

() Object

create plain object

Returns:

Object:

plainObject

updateAttributes

(
  • data
)
Object public

Update set of attributes.

Parameters:

  • data Object

Returns:

Object:

upsert

(
  • data
)
Object public

Update or insert a model instance The update will override any specified attributes in the request data object. It won’t remove existing ones unless the value is set to null.

Parameters:

  • data Object

Returns:

Object: