Oihana PHP System

hydrateDocumentLineItem.php

Table of Contents

Functions

hydrateDocumentLineItem()  : mixed
Hydrate an array definition with the product or service class of a document line item.

Functions

hydrateDocumentLineItem()

Hydrate an array definition with the product or service class of a document line item.

hydrateDocumentLineItem([mixed $init = null ]) : mixed

The item of a BusinessDocumentLine is typed as a Product|Service union, which no property type can resolve on its own : the target class is therefore read from the payload's JSON-LD @type.

  • a @type ending with Service (e.g. Service, FoodService) gives a Service ;
  • anything else gives a Product — the commerce-enriched product of this package, which is a org\schema\Product and so satisfies the line's declared type.
Parameters
$init : mixed = null

Single item data or array of item data.

Tags
throws
HydrationException
ReflectionException
On this page

Search results