-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: cleanup for making relationships and their types more consi…
…stent The commit has some unfinished work
- Loading branch information
1 parent
83cffd3
commit e3aaaee
Showing
39 changed files
with
12,192 additions
and
10,515 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/** | ||
* Save the related model. | ||
*/ | ||
save (model: T, wrapInTransaction?: boolean): Promise<void> | ||
|
||
/** | ||
* Save the related model. | ||
*/ | ||
saveMany (model: T[], wrapInTransaction?: boolean): Promise<void> | ||
|
||
/** | ||
* Create the related model instance | ||
*/ | ||
create (values: ModelObject, wrapInTransaction?: boolean): Promise<T> | ||
|
||
/** | ||
* Create many of the related model instance | ||
*/ | ||
createMany (values: ModelObject[], wrapInTransaction?: boolean): Promise<T[]> | ||
|
||
/** | ||
* Update the relationship or create a new one | ||
*/ | ||
updateOrCreate ( | ||
search: ModelObject, | ||
updatePayload: ModelObject, | ||
wrapInTransaction?: boolean, | ||
): Promise<T> | ||
|
||
|
||
|
||
|
||
/** | ||
* Associate related model. | ||
*/ | ||
associate (model: T, wrapInTransaction?: boolean): Promise<void> | ||
|
||
/** | ||
* Dissociate all relationships. | ||
*/ | ||
dissociate (): Promise<void> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
/** | ||
* Save related model | ||
*/ | ||
save (model: T, wrapInTransaction?: boolean, checkExisting?: boolean): Promise<void> | ||
|
||
/** | ||
* Save related many | ||
*/ | ||
saveMany (model: T[], wrapInTransaction?: boolean, checkExisting?: boolean): Promise<void> | ||
|
||
/** | ||
* Create the related model instance | ||
*/ | ||
create (values: ModelObject, wrapInTransaction?: boolean, checkExisting?: boolean): Promise<T> | ||
|
||
/** | ||
* Create many of the related model instance | ||
*/ | ||
createMany (values: ModelObject, wrapInTransaction?: boolean, checkExisting?: boolean): Promise<T[]> | ||
|
||
/** | ||
* Attach related | ||
*/ | ||
attach ( | ||
ids: (string | number)[] | { [key: string]: ModelObject }, | ||
checkExisting?: boolean, | ||
): Promise<void> | ||
|
||
/** | ||
* Detach from pivot table | ||
*/ | ||
detach (ids: (string | number)[]): Promise<void> | ||
|
||
/** | ||
* Sync related ids | ||
*/ | ||
sync ( | ||
ids: (string | number)[] | { [key: string]: ModelObject }, | ||
wrapInTransaction?: boolean, | ||
checkExisting?: boolean, | ||
): Promise<void> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.