remove orphan edges

This commit is contained in:
2023-11-29 17:10:15 +02:00
parent 2e5c80e1f6
commit ba25850191
11 changed files with 114 additions and 16 deletions
+19 -3
View File
@@ -4,12 +4,14 @@ use Lucent\LucentException;
class EdgeService
{
public function __construct(public EdgeRepo $edgeRepo)
{
}
/**
* @throws LucentException
*/
public static function create(
public function create(
string $source,
string $target,
string $sourceSchema,
@@ -29,9 +31,23 @@ class EdgeService
field: $field,
rank: $rank,
);
EdgeRepo::insert($edge);
$this->edgeRepo->insert($edge);
return $edge;
}
public function update(string $from, EdgeCollection $edges): void
{
$this->edgeRepo->update($from, $edges);
}
public function findAll(): EdgeCollection
{
return $this->edgeRepo->findAll();
}
public function remove(Edge $edge): void
{
$this->edgeRepo->remove($edge);
}
}