Stack

This is a data type that implements the Stack class, and provides first in first out functionality, meaning you push items onto the bottom of the stack, and pull them off the top of the stack. All items within the stack are restricted to a specific class. You may create a new stack using the opus stack CLI command, such as:

apex opus stack <FILENAME> --item-class <PATH_TO_ITEM_CLASS>

apex opus stack MyShop/PaymentStack --item-class MyShop/Mdoels/Payment

Using the above example, a ew file is created at /src/MyShop/ProductStack.php, with all items restricted to the App\MyShop\Models\Payment class. You can now use the standard push() and pull() methods to add and retrieve items from the stack.