__construct()
__construct(integer $id = null,string $language = null)
Basket constructor.
Instance a new basket object
Parameters
integer | $id | A basket id |
string | $language | The basket language |
GetOwner(): \FAA\Obj\Generic\User|null
Get the owner of this basket
ToPlainObject(string $language = null,boolean $with_parent = true): \stdClass
Resolve to object
Convert the basket to loadable object including a resolve of the child articles
string | $language | The target language |
boolean | $with_parent | Include parent properties |
The basket as object
CompleteOrder(\FAA\Obj\Request $request): \FAA\Obj\Result
Finish order Confirm the order and send the billing mails.
\FAA\Obj\Request | $request | A system request object |
A system result object
ChangeStatus(\FAA\Obj\Request|string $request,array $data): \FAA\Obj\Result
Change the basket status Execute the registered changes for this status change
\FAA\Obj\Request|string | $request | The system request object or a language |
array | $data | The status change elements status string The target status, defined by basket object comment string The status change log entry |
A system result object
MailPreview(string $language,string $template,string $type = 'html'): \FAA\Obj\Result
Create mail preview
Create the text or html email based on a given template and the basket
string | $language | The request language |
string | $template | The template id |
string | $type | html/txt template |
A system result object
FormatTitle(string $template,string $language): string
Format the title Enrich the title template with additional information. Token to replace are {id}, {cid} and {name}
string | $template | The template to translate |
string | $language | Target language code |
The translated label
GetPaymentMethod(): \FAA\Interfaces\PaymentMethod
Get assigned payment method Get the handler of assigned payment method.
A payment method handler
GetDeliveryMethod(string $version = null): \FAA\Interfaces\DeliveryMethod
Get assigned delivery method Get the handler of assigned delivery method.
string | $version | A git hash with the used delivery method version |
A delivery method handler
ListArticles(string $language = null): array<mixed,\FAA\Obj\Sys\ArticleAssignment>
Get list of articles relation
string | $language | The target resolve language |
List of assignments
ChangePaymentMethod(string $method,boolean $store = true): \FAA\Obj\Result
Change payment method
Changes the payment method of the current basket object The given id must match an active registered payment method and the basket must be registered in the session.
string | $method | The new method name |
boolean | $store | Flag to tell the system to persist the change, defaults to true |
A system result object
ChangeDeliveryMethod(string $method,boolean $store = true): \FAA\Obj\Result
Change delivery method
Changes the delivery method of the current basket object The given id must match an active registered delivery method and the basket must be registered in the session. The new delivery method must be compatible with the other options inside the basket so succeed.
string | $method | The new method name |
boolean | $store | Flag to tell the system to persist the change, defaults to true |
A system result object
AddArticle(string|integer $content_id,string $type,integer $amount = 1,boolean $replace = false): \FAA\Obj\Result
Add or, replace article
Adds an article by id and type to the current basket This method can either add at the end or override the article by id and type
string|integer | $content_id | The related article object content id |
string | $type | The object type name |
integer | $amount | Amount of entries to add, defaults to 1 |
boolean | $replace | Replace instead of add, defaults to false |
A system result object
ChangeArticleAmount(integer $index,integer $amount = 1,integer|string $content_id = null,string $content_type = null): \FAA\Obj\Result
Change article amount and article on demand
This method changes the relation amount in the assigned articles list to the given number. Method will fail when the index is out of boundaries
integer | $index | The index of the article inside the basket |
integer | $amount | The new amount, can be either positive or negative |
integer|string | $content_id | A article content id, can be used to change the assigned article at the same time |
string | $content_type | A article content type, must be set to change the assigned article at the same time |
A system result object
RemoveArticle(integer $index): \FAA\Obj\Result
Delete article from basket
Removes the element by index from array of articles and calls the object saver afterwards. Method will fail when the index is out of boundaries
integer | $index | The index of the article inside the basket |
A system result object
GetTotalPriceFormated(boolean $tax = false,boolean $de = true): string
Format the price
Returns a formatted price with or without tax included. Right now it does support the german formatting by default
boolean | $tax | Include the taxes when true |
boolean | $de | Use the format 100.000,45 |
The price
BasketStatusChangeMail(string $lang,array $payload,array $config): \FAA\Obj\Result
Send status mail
Sed the fitting status changed mail
string | $lang | The language key |
array | $payload | The status change elements status string The target status, defined by basket object comment string The status change log entry |
array | $config | The email configuration object |
A system result object