Document

Contracts

DocumentRepositoryContract

Download and list order documents as well as download, list, upload and delete category documents.

Namespace

Plenty\Modules\Document\Contracts

Methods

public getDocumentPath(int $id):void

Get the path to a document

Parameters
int $id The ID of the document
public findById(int $id, array $columns = []):Document

Get a document

Parameters
int $id The ID of the document
array $columns The columns to be loaded
public find(int $page = 1, int $itemsPerPage = 50, array $columns = [], array $with = []):PaginatedResult

List documents

Parameters
int $page The page to get. The default page that will be returned is page 1.
int $itemsPerPage The number of orders to be displayed per page. The default number of orders per page is 50.
array $columns The columns to be loaded
array $with The relations to be loaded. Possible value is "references".
public uploadOrderDocuments(int $orderId, string $type, array $data):array

Upload order documents

Parameters
int $orderId The ID of the order
string $type The document type. Supported types are 'invoiceExternal', 'deliveryNote', 'orderConfirmation', 'offer', 'dunningLetter', 'returnNote', 'successConfirmation', 'correction'.
array $data The request data
public uploadCategoryDocuments(int $categoryId, array $data):array

Upload category documents

Parameters
int $categoryId The ID of the category
array $data The request data
public deleteCategoryDocument(int $categoryId, int $documentId):bool

Delete a category document.

Parameters
int $categoryId The ID of the category
int $documentId The ID of the document
public uploadOrderShippingPackageDocuments(int $packageId, string $type, string $document):array
Parameters
int $packageId
string $type
string $document base64 encoded document
public findOrderShippingPackageDocuments(int $packageId, string $type):array
Parameters
int $packageId
string $type
public deleteOrderShippingPackageDocuments(int $packageId):bool
Parameters
int $packageId
public getDocumentStorageObject($key):void
Parameters
$key
public uploadOrderReturnsDocuments(int $returnsId, string $document):Document
Parameters
int $returnsId
string $document
public getOrderReturnsDocumentById(int $returnsId, bool $withLabel = false):Document
Parameters
int $returnsId
bool $withLabel
public clearCriteria():void

Resets all Criteria filters by creating a new instance of the builder object.

public applyCriteriaFromFilters():void

Applies criteria classes to the current repository.

public setFilters(array $filters = []):void

Sets the filter array.

Parameters
array $filters
public getFilters():void

Returns the filter array.

public getConditions():void

Returns a collection of parsed filters as Condition object

public clearFilters():void

Clears the filter array.

Models

DocumentReference

The document reference model. A document reference allows you to assign a document to other models.

Namespace

Plenty\Modules\Document\Models

Properties

Type Name Description
int documentId The ID of the document
string type The reference type. The following reference types are available:
  • blog
  • cash_register
  • category
  • customer
  • facet
  • facet_value
  • item
  • multishop
  • order
  • reorder
  • ticket
  • warehouse
  • order_shipping_package
string value The reference value (e.g. the ID of another model)

Methods

public toArray()

Returns this model as an array.

Document

The document model contains information about actual documents.

Namespace

Plenty\Modules\Document\Models

Properties

Type Name Description
int id The ID of the document
string type The type of the document. The following types are available:
  • admin
  • blog
  • category
  • correction_document
  • credit_note
  • customer
  • delivery_note
  • dunning_letter
  • ebics_hash
  • facet
  • invoice
  • invoice_external
  • pos_invoice
  • pos_invoice_cancellation
  • item
  • multi_credit_note
  • multi_invoice
  • offer
  • order_confirmation
  • pickup_delivery
  • receipt
  • refund_reversal
  • reorder
  • repair_bill
  • return_note
  • reversal_document
  • settlement_report
  • success_confirmation
  • ticket
  • webshop
  • webshop_customer
  • z_report
  • shipping_label
  • shipping_export_label
  • returns_label
int number The document number
string numberWithPrefix The document number with prefix
string path The path to the document
int userId The ID of the user
string source The source where the document was generated. Possible sources are 'klarna', 'soap', 'admin', 'hitmeister', 'paypal' and 'rest'.
string displayDate The date displayed on the document
string content The base64 encodedcontent of the document.
createdAt The time the document was created
updatedAt The time the document was last updated
Collection references Collection of document references. The references available are:
  • contacts
  • orders
  • webstores = refers to clients
  • categories
Collection contacts Collection of contacts that are associated with the document
Collection orders Collection of orders that are associated with the document
Collection webstores Collection of webstores that are associated with the document
Collection categories Collection of categories that are associated with the document

Methods

public toArray()

Returns this model as an array.