MemoryResource Class
sync memory storage, implements ResourceClientInterface
Item Index
Methods
count
()
Number
Count all registered data
Returns:
Number:
total
create
(
Object
public
-
data
Create new instance of Model class, saved in database
Parameters:
-
data
Object
Returns:
Object:
destroyById
(
public
-
data
Destroy model instance
Parameters:
-
data
Object
destroyById
(
public
-
id
Destroy model instance with the specified ID.
Parameters:
-
id
String
find
(
Array(Object)
public
-
filter
Find all model instances that match filter specification.
Parameters:
-
filter
Object
Returns:
Array(Object):
findById
(
Object
public
-
id
Find object by ID.
Parameters:
-
id
String
Returns:
Object:
findOne
(
Object
public
-
filter
Find one model instance that matches filter specification. Same as find, but limited to one result
Parameters:
-
filter
Object
Returns:
Object:
generateId
(
String
public
-
data
Generate id
Parameters:
-
data
Object
Returns:
String:
toPlainObject
()
Object
create plain object
Returns:
Object:
plainObject
updateAttributes
(
Object
public
-
data
Update set of attributes.
Parameters:
-
data
Object
Returns:
Object:
upsert
(
Object
public
-
data
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: