38 lines
631 B
PHP
38 lines
631 B
PHP
|
|
<?php namespace Lucent\Edge;
|
||
|
|
|
||
|
|
use Lucent\LucentException;
|
||
|
|
|
||
|
|
class EdgeService
|
||
|
|
{
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @throws LucentException
|
||
|
|
*/
|
||
|
|
public static function create(
|
||
|
|
string $source,
|
||
|
|
string $target,
|
||
|
|
string $sourceSchema,
|
||
|
|
string $targetSchema,
|
||
|
|
string $field,
|
||
|
|
string $rank,
|
||
|
|
): Edge
|
||
|
|
{
|
||
|
|
|
||
|
|
|
||
|
|
$edge = new Edge(
|
||
|
|
|
||
|
|
source: $source,
|
||
|
|
target: $target,
|
||
|
|
sourceSchema: $sourceSchema,
|
||
|
|
targetSchema: $targetSchema,
|
||
|
|
field: $field,
|
||
|
|
rank: $rank,
|
||
|
|
);
|
||
|
|
EdgeRepo::insert($edge);
|
||
|
|
return $edge;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|