You are here

public function Invoice::setFile in Commerce Invoice 8.2

Sets the invoice file (i.e the reference to the generated PDF file).

Parameters

\Drupal\file\FileInterface $file: The invoice file.

Return value

$this

Overrides InvoiceInterface::setFile

File

src/Entity/Invoice.php, line 561

Class

Invoice
Defines the invoice entity class.

Namespace

Drupal\commerce_invoice\Entity

Code

public function setFile(FileInterface $file) {
  $this
    ->set('invoice_file', $file
    ->id());
  return $this;
}