Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Reservation Class Reference
Inheritance diagram for Reservation:
ReservationInterface

Public Member Functions

 __construct ( $reservationId, int $stockId, string $sku, float $quantity, $metadata=null)
 
 getReservationId ()
 
 getStockId ()
 
 getSku ()
 
 getQuantity ()
 
 getMetadata ()
 

Additional Inherited Members

- Data Fields inherited from ReservationInterface
const RESERVATION_ID = 'reservation_id'
 
const STOCK_ID = 'stock_id'
 
const SKU = 'sku'
 
const QUANTITY = 'quantity'
 
const METADATA = 'metadata'
 

Detailed Description

{}

@codeCoverageIgnore

Definition at line 17 of file Reservation.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $reservationId,
int  $stockId,
string  $sku,
float  $quantity,
  $metadata = null 
)
Parameters
int | null$reservationId
int$stockId
string$sku
float$quantity
null$metadata

Definition at line 51 of file Reservation.php.

57  {
58  $this->reservationId = $reservationId;
59  $this->stockId = $stockId;
60  $this->sku = $sku;
61  $this->quantity = $quantity;
62  $this->metadata = $metadata;
63  }

Member Function Documentation

◆ getMetadata()

getMetadata ( )

Get Reservation MetadataMetadata is used to store serialized data that encapsulates the semantic of a Reservation.

Returns
string|null

Implements ReservationInterface.

Definition at line 102 of file Reservation.php.

102  : ?string
103  {
104  return $this->metadata;
105  }

◆ getQuantity()

getQuantity ( )

Get Product QtyThis value can be positive (>0) or negative (<0) depending on the Reservation semantic.For example, when an Order is placed, a Reservation with negative quantity is appended. When that Order is processed and the SourceItems related to ordered products are updated, a Reservation with positive quantity is appended to neglect the first one.

Returns
float

Implements ReservationInterface.

Definition at line 94 of file Reservation.php.

94  : float
95  {
96  return $this->quantity;
97  }

◆ getReservationId()

getReservationId ( )

Get Reservation Id

Returns
int|null

Implements ReservationInterface.

Definition at line 68 of file Reservation.php.

68  : ?int
69  {
70  return $this->reservationId === null ?
71  null:
72  (int)$this->reservationId;
73  }

◆ getSku()

getSku ( )

Get Product SKU

Returns
string

Implements ReservationInterface.

Definition at line 86 of file Reservation.php.

86  : string
87  {
88  return $this->sku;
89  }

◆ getStockId()

getStockId ( )

Get Stock Id

Returns
int

Implements ReservationInterface.

Definition at line 78 of file Reservation.php.

78  : int
79  {
80  return $this->stockId;
81  }

The documentation for this class was generated from the following file: