edges wip
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php namespace Lucent\Core\Repository;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Lucent\Core\Data\Edge;
|
||||
use Lucent\Core\Edge\EdgeModule;
|
||||
|
||||
class EdgeRepo
|
||||
{
|
||||
const TABLE_NAME = "edges";
|
||||
|
||||
/**
|
||||
* Insert multiple edges into the database.
|
||||
*
|
||||
* @param Edge[] $edges An array of Edge objects to be inserted.
|
||||
*/
|
||||
public static function insertMany(array $edges): void
|
||||
{
|
||||
DB::table(self::TABLE_NAME)->insert(
|
||||
array_map(EdgeModule::toDb(...), $edges),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user