. // }}} namespace Component\Link; use App\Core\DB\DB; use App\Core\Modules\Component; use App\Entity; use App\Entity\NoteToLink; use App\Util\Common; use InvalidArgumentException; class Link extends Component { /** * "Perfect URL Regex", courtesy of https://urlregex.com/ */ const URL_REGEX = <<getId(); DB::persist(NoteToLink::create(['link_id' => $link_id, 'note_id' => $note_id])); $processed_urls = true; } catch (InvalidArgumentException) { continue; } } if ($processed_urls) { DB::flush(); } } } }