public function item2DBImpl($path, $datasetId) { $fh = fopen($path, 'r'); $standardItemsMap = StandardItem::StandardItemsMap($datasetId); while ($line = fgets($fh)) { $row = explode(",", $line); Item::create(['path' => $row[1], 'standard_item_id' => $standardItemsMap[$row[0]]]); } fclose($fh); }