-
-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathRelationshipAdapterInterface.php
More file actions
36 lines (32 loc) · 1.03 KB
/
RelationshipAdapterInterface.php
File metadata and controls
36 lines (32 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
declare(strict_types=1);
namespace Workflow\Domain\Contracts;
/**
* Interface for handling database-specific relationship operations.
*
* Different database backends (SQL with pivot tables, MongoDB with pivot collections)
* implement this interface to provide consistent relationship behavior.
*/
interface RelationshipAdapterInterface
{
/**
* Create a BelongsToMany relationship for children.
*/
public function createChildrenRelation(
\Illuminate\Database\Eloquent\Model $parent,
string $relatedClass,
string $table,
string $foreignPivotKey,
string $relatedPivotKey
): \Illuminate\Database\Eloquent\Relations\BelongsToMany;
/**
* Create a BelongsToMany relationship for parents.
*/
public function createParentsRelation(
\Illuminate\Database\Eloquent\Model $parent,
string $relatedClass,
string $table,
string $foreignPivotKey,
string $relatedPivotKey
): \Illuminate\Database\Eloquent\Relations\BelongsToMany;
}