@h3ravel/arquebus 0.6.17 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/index.cjs +8 -7
- package/bin/index.js +8 -7
- package/dist/concerns/chunk-Bop6jNiL.js +15 -0
- package/dist/concerns/index.cjs +3540 -0
- package/dist/concerns/index.d.ts +5226 -0
- package/dist/concerns/index.js +3457 -0
- package/dist/index.cjs +8 -7
- package/dist/index.js +8 -7
- package/dist/inspector/index.cjs +8 -7
- package/dist/inspector/index.js +8 -7
- package/dist/migrations/index.cjs +8 -7
- package/dist/migrations/index.js +8 -7
- package/dist/relations/index.cjs +3464 -0
- package/dist/relations/index.d.ts +2 -0
- package/dist/relations/index.js +3441 -0
- package/package.json +21 -1
- package/types/generics.ts +19 -19
package/dist/index.cjs
CHANGED
|
@@ -1228,7 +1228,8 @@ const HasRelations = (Model$1) => {
|
|
|
1228
1228
|
return data;
|
|
1229
1229
|
}
|
|
1230
1230
|
guessBelongsToRelation() {
|
|
1231
|
-
|
|
1231
|
+
var _e$stack;
|
|
1232
|
+
const functionName = (((_e$stack = (/* @__PURE__ */ new Error()).stack) === null || _e$stack === void 0 ? void 0 : _e$stack.split("\n")[2]) ?? "").split(" ")[5];
|
|
1232
1233
|
return getRelationName(functionName);
|
|
1233
1234
|
}
|
|
1234
1235
|
joiningTable(related, instance = null) {
|
|
@@ -1237,21 +1238,21 @@ const HasRelations = (Model$1) => {
|
|
|
1237
1238
|
joiningTableSegment() {
|
|
1238
1239
|
return snakeCase(this.constructor.name);
|
|
1239
1240
|
}
|
|
1240
|
-
hasOne(related, foreignKey
|
|
1241
|
+
hasOne(related, foreignKey, localKey) {
|
|
1241
1242
|
const query = related.query();
|
|
1242
1243
|
const instance = new related();
|
|
1243
1244
|
foreignKey = foreignKey || this.getForeignKey();
|
|
1244
1245
|
localKey = localKey || this.getKeyName();
|
|
1245
1246
|
return new has_one_default(query, this, instance.getTable() + "." + foreignKey, localKey);
|
|
1246
1247
|
}
|
|
1247
|
-
hasMany(related, foreignKey
|
|
1248
|
+
hasMany(related, foreignKey, localKey) {
|
|
1248
1249
|
const query = related.query();
|
|
1249
1250
|
const instance = new related();
|
|
1250
1251
|
foreignKey = foreignKey || this.getForeignKey();
|
|
1251
1252
|
localKey = localKey || this.getKeyName();
|
|
1252
1253
|
return new has_many_default(query, this, instance.getTable() + "." + foreignKey, localKey);
|
|
1253
1254
|
}
|
|
1254
|
-
belongsTo(related, foreignKey
|
|
1255
|
+
belongsTo(related, foreignKey, ownerKey, relation) {
|
|
1255
1256
|
const query = related.query();
|
|
1256
1257
|
const instance = new related();
|
|
1257
1258
|
foreignKey = foreignKey || instance.getForeignKey();
|
|
@@ -1259,7 +1260,7 @@ const HasRelations = (Model$1) => {
|
|
|
1259
1260
|
relation = relation || this.guessBelongsToRelation();
|
|
1260
1261
|
return new belongs_to_default(query, this, foreignKey, ownerKey, relation);
|
|
1261
1262
|
}
|
|
1262
|
-
belongsToMany(related, table
|
|
1263
|
+
belongsToMany(related, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey) {
|
|
1263
1264
|
const query = related.query();
|
|
1264
1265
|
const instance = new related();
|
|
1265
1266
|
table = table || this.joiningTable(related, instance);
|
|
@@ -1269,14 +1270,14 @@ const HasRelations = (Model$1) => {
|
|
|
1269
1270
|
relatedKey = relatedKey || instance.getKeyName();
|
|
1270
1271
|
return new belongs_to_many_default(query, this, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey);
|
|
1271
1272
|
}
|
|
1272
|
-
hasOneThrough(related, through, firstKey
|
|
1273
|
+
hasOneThrough(related, through, firstKey, secondKey, localKey, secondLocalKey) {
|
|
1273
1274
|
through = new through();
|
|
1274
1275
|
const query = related.query();
|
|
1275
1276
|
firstKey = firstKey || this.getForeignKey();
|
|
1276
1277
|
secondKey = secondKey || through.getForeignKey();
|
|
1277
1278
|
return new has_one_through_default(query, this, through, firstKey, secondKey, localKey || this.getKeyName(), secondLocalKey || through.getKeyName());
|
|
1278
1279
|
}
|
|
1279
|
-
hasManyThrough(related, through, firstKey
|
|
1280
|
+
hasManyThrough(related, through, firstKey, secondKey, localKey, secondLocalKey) {
|
|
1280
1281
|
through = new through();
|
|
1281
1282
|
const query = related.query();
|
|
1282
1283
|
firstKey = firstKey || this.getForeignKey();
|
package/dist/index.js
CHANGED
|
@@ -1202,7 +1202,8 @@ const HasRelations = (Model$1) => {
|
|
|
1202
1202
|
return data;
|
|
1203
1203
|
}
|
|
1204
1204
|
guessBelongsToRelation() {
|
|
1205
|
-
|
|
1205
|
+
var _e$stack;
|
|
1206
|
+
const functionName = (((_e$stack = (/* @__PURE__ */ new Error()).stack) === null || _e$stack === void 0 ? void 0 : _e$stack.split("\n")[2]) ?? "").split(" ")[5];
|
|
1206
1207
|
return getRelationName(functionName);
|
|
1207
1208
|
}
|
|
1208
1209
|
joiningTable(related, instance = null) {
|
|
@@ -1211,21 +1212,21 @@ const HasRelations = (Model$1) => {
|
|
|
1211
1212
|
joiningTableSegment() {
|
|
1212
1213
|
return snakeCase(this.constructor.name);
|
|
1213
1214
|
}
|
|
1214
|
-
hasOne(related, foreignKey
|
|
1215
|
+
hasOne(related, foreignKey, localKey) {
|
|
1215
1216
|
const query = related.query();
|
|
1216
1217
|
const instance = new related();
|
|
1217
1218
|
foreignKey = foreignKey || this.getForeignKey();
|
|
1218
1219
|
localKey = localKey || this.getKeyName();
|
|
1219
1220
|
return new has_one_default(query, this, instance.getTable() + "." + foreignKey, localKey);
|
|
1220
1221
|
}
|
|
1221
|
-
hasMany(related, foreignKey
|
|
1222
|
+
hasMany(related, foreignKey, localKey) {
|
|
1222
1223
|
const query = related.query();
|
|
1223
1224
|
const instance = new related();
|
|
1224
1225
|
foreignKey = foreignKey || this.getForeignKey();
|
|
1225
1226
|
localKey = localKey || this.getKeyName();
|
|
1226
1227
|
return new has_many_default(query, this, instance.getTable() + "." + foreignKey, localKey);
|
|
1227
1228
|
}
|
|
1228
|
-
belongsTo(related, foreignKey
|
|
1229
|
+
belongsTo(related, foreignKey, ownerKey, relation) {
|
|
1229
1230
|
const query = related.query();
|
|
1230
1231
|
const instance = new related();
|
|
1231
1232
|
foreignKey = foreignKey || instance.getForeignKey();
|
|
@@ -1233,7 +1234,7 @@ const HasRelations = (Model$1) => {
|
|
|
1233
1234
|
relation = relation || this.guessBelongsToRelation();
|
|
1234
1235
|
return new belongs_to_default(query, this, foreignKey, ownerKey, relation);
|
|
1235
1236
|
}
|
|
1236
|
-
belongsToMany(related, table
|
|
1237
|
+
belongsToMany(related, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey) {
|
|
1237
1238
|
const query = related.query();
|
|
1238
1239
|
const instance = new related();
|
|
1239
1240
|
table = table || this.joiningTable(related, instance);
|
|
@@ -1243,14 +1244,14 @@ const HasRelations = (Model$1) => {
|
|
|
1243
1244
|
relatedKey = relatedKey || instance.getKeyName();
|
|
1244
1245
|
return new belongs_to_many_default(query, this, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey);
|
|
1245
1246
|
}
|
|
1246
|
-
hasOneThrough(related, through, firstKey
|
|
1247
|
+
hasOneThrough(related, through, firstKey, secondKey, localKey, secondLocalKey) {
|
|
1247
1248
|
through = new through();
|
|
1248
1249
|
const query = related.query();
|
|
1249
1250
|
firstKey = firstKey || this.getForeignKey();
|
|
1250
1251
|
secondKey = secondKey || through.getForeignKey();
|
|
1251
1252
|
return new has_one_through_default(query, this, through, firstKey, secondKey, localKey || this.getKeyName(), secondLocalKey || through.getKeyName());
|
|
1252
1253
|
}
|
|
1253
|
-
hasManyThrough(related, through, firstKey
|
|
1254
|
+
hasManyThrough(related, through, firstKey, secondKey, localKey, secondLocalKey) {
|
|
1254
1255
|
through = new through();
|
|
1255
1256
|
const query = related.query();
|
|
1256
1257
|
firstKey = firstKey || this.getForeignKey();
|
package/dist/inspector/index.cjs
CHANGED
|
@@ -2454,7 +2454,8 @@ const HasRelations = (Model$1) => {
|
|
|
2454
2454
|
return data;
|
|
2455
2455
|
}
|
|
2456
2456
|
guessBelongsToRelation() {
|
|
2457
|
-
|
|
2457
|
+
var _e$stack;
|
|
2458
|
+
const functionName = (((_e$stack = (/* @__PURE__ */ new Error()).stack) === null || _e$stack === void 0 ? void 0 : _e$stack.split("\n")[2]) ?? "").split(" ")[5];
|
|
2458
2459
|
return getRelationName(functionName);
|
|
2459
2460
|
}
|
|
2460
2461
|
joiningTable(related, instance = null) {
|
|
@@ -2463,21 +2464,21 @@ const HasRelations = (Model$1) => {
|
|
|
2463
2464
|
joiningTableSegment() {
|
|
2464
2465
|
return snakeCase(this.constructor.name);
|
|
2465
2466
|
}
|
|
2466
|
-
hasOne(related, foreignKey
|
|
2467
|
+
hasOne(related, foreignKey, localKey) {
|
|
2467
2468
|
const query = related.query();
|
|
2468
2469
|
const instance = new related();
|
|
2469
2470
|
foreignKey = foreignKey || this.getForeignKey();
|
|
2470
2471
|
localKey = localKey || this.getKeyName();
|
|
2471
2472
|
return new has_one_default(query, this, instance.getTable() + "." + foreignKey, localKey);
|
|
2472
2473
|
}
|
|
2473
|
-
hasMany(related, foreignKey
|
|
2474
|
+
hasMany(related, foreignKey, localKey) {
|
|
2474
2475
|
const query = related.query();
|
|
2475
2476
|
const instance = new related();
|
|
2476
2477
|
foreignKey = foreignKey || this.getForeignKey();
|
|
2477
2478
|
localKey = localKey || this.getKeyName();
|
|
2478
2479
|
return new has_many_default(query, this, instance.getTable() + "." + foreignKey, localKey);
|
|
2479
2480
|
}
|
|
2480
|
-
belongsTo(related, foreignKey
|
|
2481
|
+
belongsTo(related, foreignKey, ownerKey, relation) {
|
|
2481
2482
|
const query = related.query();
|
|
2482
2483
|
const instance = new related();
|
|
2483
2484
|
foreignKey = foreignKey || instance.getForeignKey();
|
|
@@ -2485,7 +2486,7 @@ const HasRelations = (Model$1) => {
|
|
|
2485
2486
|
relation = relation || this.guessBelongsToRelation();
|
|
2486
2487
|
return new belongs_to_default(query, this, foreignKey, ownerKey, relation);
|
|
2487
2488
|
}
|
|
2488
|
-
belongsToMany(related, table
|
|
2489
|
+
belongsToMany(related, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey) {
|
|
2489
2490
|
const query = related.query();
|
|
2490
2491
|
const instance = new related();
|
|
2491
2492
|
table = table || this.joiningTable(related, instance);
|
|
@@ -2495,14 +2496,14 @@ const HasRelations = (Model$1) => {
|
|
|
2495
2496
|
relatedKey = relatedKey || instance.getKeyName();
|
|
2496
2497
|
return new belongs_to_many_default(query, this, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey);
|
|
2497
2498
|
}
|
|
2498
|
-
hasOneThrough(related, through, firstKey
|
|
2499
|
+
hasOneThrough(related, through, firstKey, secondKey, localKey, secondLocalKey) {
|
|
2499
2500
|
through = new through();
|
|
2500
2501
|
const query = related.query();
|
|
2501
2502
|
firstKey = firstKey || this.getForeignKey();
|
|
2502
2503
|
secondKey = secondKey || through.getForeignKey();
|
|
2503
2504
|
return new has_one_through_default(query, this, through, firstKey, secondKey, localKey || this.getKeyName(), secondLocalKey || through.getKeyName());
|
|
2504
2505
|
}
|
|
2505
|
-
hasManyThrough(related, through, firstKey
|
|
2506
|
+
hasManyThrough(related, through, firstKey, secondKey, localKey, secondLocalKey) {
|
|
2506
2507
|
through = new through();
|
|
2507
2508
|
const query = related.query();
|
|
2508
2509
|
firstKey = firstKey || this.getForeignKey();
|
package/dist/inspector/index.js
CHANGED
|
@@ -2430,7 +2430,8 @@ const HasRelations = (Model$1) => {
|
|
|
2430
2430
|
return data;
|
|
2431
2431
|
}
|
|
2432
2432
|
guessBelongsToRelation() {
|
|
2433
|
-
|
|
2433
|
+
var _e$stack;
|
|
2434
|
+
const functionName = (((_e$stack = (/* @__PURE__ */ new Error()).stack) === null || _e$stack === void 0 ? void 0 : _e$stack.split("\n")[2]) ?? "").split(" ")[5];
|
|
2434
2435
|
return getRelationName(functionName);
|
|
2435
2436
|
}
|
|
2436
2437
|
joiningTable(related, instance = null) {
|
|
@@ -2439,21 +2440,21 @@ const HasRelations = (Model$1) => {
|
|
|
2439
2440
|
joiningTableSegment() {
|
|
2440
2441
|
return snakeCase(this.constructor.name);
|
|
2441
2442
|
}
|
|
2442
|
-
hasOne(related, foreignKey
|
|
2443
|
+
hasOne(related, foreignKey, localKey) {
|
|
2443
2444
|
const query = related.query();
|
|
2444
2445
|
const instance = new related();
|
|
2445
2446
|
foreignKey = foreignKey || this.getForeignKey();
|
|
2446
2447
|
localKey = localKey || this.getKeyName();
|
|
2447
2448
|
return new has_one_default(query, this, instance.getTable() + "." + foreignKey, localKey);
|
|
2448
2449
|
}
|
|
2449
|
-
hasMany(related, foreignKey
|
|
2450
|
+
hasMany(related, foreignKey, localKey) {
|
|
2450
2451
|
const query = related.query();
|
|
2451
2452
|
const instance = new related();
|
|
2452
2453
|
foreignKey = foreignKey || this.getForeignKey();
|
|
2453
2454
|
localKey = localKey || this.getKeyName();
|
|
2454
2455
|
return new has_many_default(query, this, instance.getTable() + "." + foreignKey, localKey);
|
|
2455
2456
|
}
|
|
2456
|
-
belongsTo(related, foreignKey
|
|
2457
|
+
belongsTo(related, foreignKey, ownerKey, relation) {
|
|
2457
2458
|
const query = related.query();
|
|
2458
2459
|
const instance = new related();
|
|
2459
2460
|
foreignKey = foreignKey || instance.getForeignKey();
|
|
@@ -2461,7 +2462,7 @@ const HasRelations = (Model$1) => {
|
|
|
2461
2462
|
relation = relation || this.guessBelongsToRelation();
|
|
2462
2463
|
return new belongs_to_default(query, this, foreignKey, ownerKey, relation);
|
|
2463
2464
|
}
|
|
2464
|
-
belongsToMany(related, table
|
|
2465
|
+
belongsToMany(related, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey) {
|
|
2465
2466
|
const query = related.query();
|
|
2466
2467
|
const instance = new related();
|
|
2467
2468
|
table = table || this.joiningTable(related, instance);
|
|
@@ -2471,14 +2472,14 @@ const HasRelations = (Model$1) => {
|
|
|
2471
2472
|
relatedKey = relatedKey || instance.getKeyName();
|
|
2472
2473
|
return new belongs_to_many_default(query, this, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey);
|
|
2473
2474
|
}
|
|
2474
|
-
hasOneThrough(related, through, firstKey
|
|
2475
|
+
hasOneThrough(related, through, firstKey, secondKey, localKey, secondLocalKey) {
|
|
2475
2476
|
through = new through();
|
|
2476
2477
|
const query = related.query();
|
|
2477
2478
|
firstKey = firstKey || this.getForeignKey();
|
|
2478
2479
|
secondKey = secondKey || through.getForeignKey();
|
|
2479
2480
|
return new has_one_through_default(query, this, through, firstKey, secondKey, localKey || this.getKeyName(), secondLocalKey || through.getKeyName());
|
|
2480
2481
|
}
|
|
2481
|
-
hasManyThrough(related, through, firstKey
|
|
2482
|
+
hasManyThrough(related, through, firstKey, secondKey, localKey, secondLocalKey) {
|
|
2482
2483
|
through = new through();
|
|
2483
2484
|
const query = related.query();
|
|
2484
2485
|
firstKey = firstKey || this.getForeignKey();
|
|
@@ -2525,7 +2525,8 @@ const HasRelations = (Model$1) => {
|
|
|
2525
2525
|
return data;
|
|
2526
2526
|
}
|
|
2527
2527
|
guessBelongsToRelation() {
|
|
2528
|
-
|
|
2528
|
+
var _e$stack;
|
|
2529
|
+
const functionName = (((_e$stack = (/* @__PURE__ */ new Error()).stack) === null || _e$stack === void 0 ? void 0 : _e$stack.split("\n")[2]) ?? "").split(" ")[5];
|
|
2529
2530
|
return getRelationName(functionName);
|
|
2530
2531
|
}
|
|
2531
2532
|
joiningTable(related, instance = null) {
|
|
@@ -2534,21 +2535,21 @@ const HasRelations = (Model$1) => {
|
|
|
2534
2535
|
joiningTableSegment() {
|
|
2535
2536
|
return snakeCase(this.constructor.name);
|
|
2536
2537
|
}
|
|
2537
|
-
hasOne(related, foreignKey
|
|
2538
|
+
hasOne(related, foreignKey, localKey) {
|
|
2538
2539
|
const query = related.query();
|
|
2539
2540
|
const instance = new related();
|
|
2540
2541
|
foreignKey = foreignKey || this.getForeignKey();
|
|
2541
2542
|
localKey = localKey || this.getKeyName();
|
|
2542
2543
|
return new has_one_default(query, this, instance.getTable() + "." + foreignKey, localKey);
|
|
2543
2544
|
}
|
|
2544
|
-
hasMany(related, foreignKey
|
|
2545
|
+
hasMany(related, foreignKey, localKey) {
|
|
2545
2546
|
const query = related.query();
|
|
2546
2547
|
const instance = new related();
|
|
2547
2548
|
foreignKey = foreignKey || this.getForeignKey();
|
|
2548
2549
|
localKey = localKey || this.getKeyName();
|
|
2549
2550
|
return new has_many_default(query, this, instance.getTable() + "." + foreignKey, localKey);
|
|
2550
2551
|
}
|
|
2551
|
-
belongsTo(related, foreignKey
|
|
2552
|
+
belongsTo(related, foreignKey, ownerKey, relation) {
|
|
2552
2553
|
const query = related.query();
|
|
2553
2554
|
const instance = new related();
|
|
2554
2555
|
foreignKey = foreignKey || instance.getForeignKey();
|
|
@@ -2556,7 +2557,7 @@ const HasRelations = (Model$1) => {
|
|
|
2556
2557
|
relation = relation || this.guessBelongsToRelation();
|
|
2557
2558
|
return new belongs_to_default(query, this, foreignKey, ownerKey, relation);
|
|
2558
2559
|
}
|
|
2559
|
-
belongsToMany(related, table
|
|
2560
|
+
belongsToMany(related, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey) {
|
|
2560
2561
|
const query = related.query();
|
|
2561
2562
|
const instance = new related();
|
|
2562
2563
|
table = table || this.joiningTable(related, instance);
|
|
@@ -2566,14 +2567,14 @@ const HasRelations = (Model$1) => {
|
|
|
2566
2567
|
relatedKey = relatedKey || instance.getKeyName();
|
|
2567
2568
|
return new belongs_to_many_default(query, this, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey);
|
|
2568
2569
|
}
|
|
2569
|
-
hasOneThrough(related, through, firstKey
|
|
2570
|
+
hasOneThrough(related, through, firstKey, secondKey, localKey, secondLocalKey) {
|
|
2570
2571
|
through = new through();
|
|
2571
2572
|
const query = related.query();
|
|
2572
2573
|
firstKey = firstKey || this.getForeignKey();
|
|
2573
2574
|
secondKey = secondKey || through.getForeignKey();
|
|
2574
2575
|
return new has_one_through_default(query, this, through, firstKey, secondKey, localKey || this.getKeyName(), secondLocalKey || through.getKeyName());
|
|
2575
2576
|
}
|
|
2576
|
-
hasManyThrough(related, through, firstKey
|
|
2577
|
+
hasManyThrough(related, through, firstKey, secondKey, localKey, secondLocalKey) {
|
|
2577
2578
|
through = new through();
|
|
2578
2579
|
const query = related.query();
|
|
2579
2580
|
firstKey = firstKey || this.getForeignKey();
|
package/dist/migrations/index.js
CHANGED
|
@@ -2487,7 +2487,8 @@ const HasRelations = (Model$1) => {
|
|
|
2487
2487
|
return data;
|
|
2488
2488
|
}
|
|
2489
2489
|
guessBelongsToRelation() {
|
|
2490
|
-
|
|
2490
|
+
var _e$stack;
|
|
2491
|
+
const functionName = (((_e$stack = (/* @__PURE__ */ new Error()).stack) === null || _e$stack === void 0 ? void 0 : _e$stack.split("\n")[2]) ?? "").split(" ")[5];
|
|
2491
2492
|
return getRelationName(functionName);
|
|
2492
2493
|
}
|
|
2493
2494
|
joiningTable(related, instance = null) {
|
|
@@ -2496,21 +2497,21 @@ const HasRelations = (Model$1) => {
|
|
|
2496
2497
|
joiningTableSegment() {
|
|
2497
2498
|
return snakeCase(this.constructor.name);
|
|
2498
2499
|
}
|
|
2499
|
-
hasOne(related, foreignKey
|
|
2500
|
+
hasOne(related, foreignKey, localKey) {
|
|
2500
2501
|
const query = related.query();
|
|
2501
2502
|
const instance = new related();
|
|
2502
2503
|
foreignKey = foreignKey || this.getForeignKey();
|
|
2503
2504
|
localKey = localKey || this.getKeyName();
|
|
2504
2505
|
return new has_one_default(query, this, instance.getTable() + "." + foreignKey, localKey);
|
|
2505
2506
|
}
|
|
2506
|
-
hasMany(related, foreignKey
|
|
2507
|
+
hasMany(related, foreignKey, localKey) {
|
|
2507
2508
|
const query = related.query();
|
|
2508
2509
|
const instance = new related();
|
|
2509
2510
|
foreignKey = foreignKey || this.getForeignKey();
|
|
2510
2511
|
localKey = localKey || this.getKeyName();
|
|
2511
2512
|
return new has_many_default(query, this, instance.getTable() + "." + foreignKey, localKey);
|
|
2512
2513
|
}
|
|
2513
|
-
belongsTo(related, foreignKey
|
|
2514
|
+
belongsTo(related, foreignKey, ownerKey, relation) {
|
|
2514
2515
|
const query = related.query();
|
|
2515
2516
|
const instance = new related();
|
|
2516
2517
|
foreignKey = foreignKey || instance.getForeignKey();
|
|
@@ -2518,7 +2519,7 @@ const HasRelations = (Model$1) => {
|
|
|
2518
2519
|
relation = relation || this.guessBelongsToRelation();
|
|
2519
2520
|
return new belongs_to_default(query, this, foreignKey, ownerKey, relation);
|
|
2520
2521
|
}
|
|
2521
|
-
belongsToMany(related, table
|
|
2522
|
+
belongsToMany(related, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey) {
|
|
2522
2523
|
const query = related.query();
|
|
2523
2524
|
const instance = new related();
|
|
2524
2525
|
table = table || this.joiningTable(related, instance);
|
|
@@ -2528,14 +2529,14 @@ const HasRelations = (Model$1) => {
|
|
|
2528
2529
|
relatedKey = relatedKey || instance.getKeyName();
|
|
2529
2530
|
return new belongs_to_many_default(query, this, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey);
|
|
2530
2531
|
}
|
|
2531
|
-
hasOneThrough(related, through, firstKey
|
|
2532
|
+
hasOneThrough(related, through, firstKey, secondKey, localKey, secondLocalKey) {
|
|
2532
2533
|
through = new through();
|
|
2533
2534
|
const query = related.query();
|
|
2534
2535
|
firstKey = firstKey || this.getForeignKey();
|
|
2535
2536
|
secondKey = secondKey || through.getForeignKey();
|
|
2536
2537
|
return new has_one_through_default(query, this, through, firstKey, secondKey, localKey || this.getKeyName(), secondLocalKey || through.getKeyName());
|
|
2537
2538
|
}
|
|
2538
|
-
hasManyThrough(related, through, firstKey
|
|
2539
|
+
hasManyThrough(related, through, firstKey, secondKey, localKey, secondLocalKey) {
|
|
2539
2540
|
through = new through();
|
|
2540
2541
|
const query = related.query();
|
|
2541
2542
|
firstKey = firstKey || this.getForeignKey();
|