protected function createFileEntity($path) {
    $uri = $this->fileUnmanagedCopy($path);
    $file = $this->entityTypeManager->getStorage('file')->create([
      'uri' => $uri,
      'status' => 1,
    ]);
    $file->save();
    $this->storeCreatedContentUuids([$file->uuid() => 'file']);
    return $file->id();
  }
protected function createFileEntity($path) {
    $uri = $this->fileUnmanagedCopy($path);
    $file = $this->entityTypeManager->getStorage('file')->create([
      'uri' => $uri,
      'status' => 1,
    ]);
    $file->save();
    $this->storeCreatedContentUuids([$file->uuid() => 'file']);
    return $file->id();
  }
protected function createFileEntity ( $ path ) { $ uri = $ this -> fileUnmanagedCopy ( $ path ) ; $ file = $ this -> entityTypeManager -> getStorage ( 'file' ) -> create ( [ 'uri' => $ uri , 'status' => 1 , ] ) ; $ file -> save ( ) ; $ this -> storeCreatedContentUuids ( [ $ file -> uuid ( ) => 'file' ] ) ; return $ file -> id ( ) ; }
Creates a file entity based on an image path.

@param string $path
Image path.

@return int
File ID.
Creates a file entity based on an image path .