You are here

public static function GetServices::getImageFid in Simple Node Importer 8

1 call to GetServices::getImageFid()
GetServices::generateFieldSetValue in src/Services/GetServices.php

File

src/Services/GetServices.php, line 816

Class

GetServices

Namespace

Drupal\simple_node_importer\Services

Code

public static function getImageFid($fileUrl) {

  // Code for image/file field..
  $file = system_retrieve_file($fileUrl, NULL, TRUE, FILE_EXISTS_REPLACE);
  $fid = !empty($file) ? $file
    ->id() : NULL;
  return $fid;
}