remove orphan edges
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user