cozy-client / HasOneInPlace
Class: HasOneInPlace¶
Here the id of the document is directly set in the attribute of the document, not in the relationships attribute
Hierarchy¶
-
↳
HasOneInPlace
Constructors¶
constructor¶
• new HasOneInPlace(target
, name
, doctype
, options
)
Parameters
Name | Type | Description |
---|---|---|
target |
any |
Original object containing raw data |
name |
string |
Attribute under which the association is stored |
doctype |
string |
Doctype of the documents managed by the association |
options |
Object |
Options passed from the client |
options.dispatch |
Function |
Store’s dispatch, comes from the client |
options.get |
Function |
Get a document from the store |
options.mutate |
Function |
Execute client mutate |
options.query |
Function |
Execute client query |
options.save |
Function |
Execute client save |
Inherited from
Defined in
packages/cozy-client/src/associations/Association.js:87
Properties¶
dispatch¶
• dispatch: Function
Dispatch an action on the store.
Inherited from
Defined in
packages/cozy-client/src/associations/Association.js:144
doctype¶
• doctype: string
Doctype of the relationship
example
‘io.cozy.authors’
Inherited from
Defined in
packages/cozy-client/src/associations/Association.js:109
get¶
• get: Function
Returns the document from the store
Inherited from
Defined in
packages/cozy-client/src/associations/Association.js:116
mutate¶
• mutate: Function
Performs a mutation on the relationship.
function
Inherited from
Defined in
packages/cozy-client/src/associations/Association.js:131
name¶
• name: string
The name of the relationship.
example
‘author’
Inherited from
Defined in
packages/cozy-client/src/associations/Association.js:101
query¶
• query: Function
Performs a query to retrieve relationship documents.
param
function
Inherited from
Defined in
packages/cozy-client/src/associations/Association.js:124
save¶
• save: Function
Saves the relationship in store.
Inherited from
Defined in
packages/cozy-client/src/associations/Association.js:138
target¶
• target: any
The original document declaring the relationship
Inherited from
Defined in
packages/cozy-client/src/associations/Association.js:94
Accessors¶
data¶
• get
data(): any
Returns
any
Overrides
Association.data
Defined in
packages/cozy-client/src/associations/HasOneInPlace.js:13
raw¶
• get
raw(): any
Returns
any
Overrides
Association.raw
Defined in
packages/cozy-client/src/associations/HasOneInPlace.js:9
Methods¶
dehydrate¶
▸ dehydrate(doc
): any
Parameters
Name | Type |
---|---|
doc |
any |
Returns
any
Defined in
packages/cozy-client/src/associations/HasOneInPlace.js:32
query¶
▸ Static
query(document
, client
, assoc
): CozyClientDocument
| QueryDefinition
Parameters
Name | Type | Description |
---|---|---|
document |
CozyClientDocument |
Document to query |
client |
any |
The CozyClient instance |
assoc |
Association |
The query params |
Returns
CozyClientDocument
| QueryDefinition
Overrides
Defined in