Order
class Order extends ReactiveObject
Traits
Properties
protected array | $hooks | from Hooks | |
protected Event[] | $eventHandlers | from Events | |
protected array | $timestamps | from Timestamps | |
protected array | $attributes | from Accessors | |
array | $modified | from Accessors | |
ReactiveObject|ItemCollection|null | $parent | from ReactiveObject | |
protected | $defaults | ||
protected array | $readOnlyAttributes | from ReactiveObject | |
protected string | $defaultOrderByField | Determines the default field to order the query by | from Queryable |
protected string | $defaultSortDirection | Determines the default direction to order the query by | from Queryable |
static | $useCache | ||
static | $cacheBaseKey | ||
static | $cacheTTL | ||
static | $sessionKey | ||
static protected | $base_path | ||
protected | $triedReceivedBySession | ||
protected | $respectPublishingStatus | ||
protected | $relation | ||
float | $order_tax | ||
float | $order_cost | ||
float | $order_total | ||
int | $customer_id | ||
string | $customer_code | ||
string | $customer_mail | ||
string | $customer_phone | ||
string | $created | ||
string | $updated | ||
bool | $abandoned | ||
bool | $abandoned_reminder_sent | ||
string | $abandoned_reminder_mail | ||
string | $status | ||
string | $type | ||
string | $ip | ||
string | $user_agent |
Methods
Attaches an event handler for a given event
Invokes the event handlers for the given event
No description
No description
No description
Same as checkout, but set checkout_end date in payload for you
Creates empty order object based on orderData
If no session exist, it creates a new empty order in API with id and secret, and adds it to session.
If no session exist, it creates a new empty order object WITHOUT id or secret.
Determine if this object respects publishing statuses when performing queries
Override the publishing status for the model
Perform an action and mutate the given key if $shouldCache is true
Cache the results with the given key if $shouldCache is true
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Return the current date and time, formatted as it is stored in the database
No description
Details
in
Hooks at line 30
void
performHook(string $name)
in
Hooks at line 40
void
performHooks()
in
Events at line 17
Events
on(string $eventName, callable $handler = null)
Attaches an event handler for a given event
in
Events at line 43
void
emit(string $event, mixed $payload = null)
Emits an event to parent
in
Events at line 57
void
trigger(string $eventName, mixed $payload = null)
Invokes the event handlers for the given event
in
Timestamps at line 18
serializeTimestamp($value)
in
Accessors at line 30
array
toArray()
Get the raw attributes
in
Accessors at line 39
mixed
__get(string $property)
in
Accessors at line 67
__set(string $property, mixed $value)
in
Accessors at line 97
bool
__isset(string $property)
in
Accessors at line 105
__unset(string $key)
in
Accessors at line 116
bool
offsetExists(string $property)
in
Accessors at line 127
mixed
offsetGet(string $property)
in
Accessors at line 137
mixed
offsetSet(string $property, mixed $value)
in
Accessors at line 146
void
offsetUnset(string $key)
in
Accessors at line 154
string
__toString()
in
ReactiveObject at line 30
__construct(object|array $attributes = [], object|null $parent = null)
in
ReactiveObject at line 53
ReactiveObject
setParent(ReactiveObject|ItemCollection|null $parent)
in
ReactiveObject at line 62
ReactiveObject|ItemCollection|null
getParent()
in
ReactiveObject at line 70
ReactiveObject|ItemCollection|null
getRootParent()
in
ReactiveObject at line 85
int
getIdAttribute(string|int $id = null)
in
ReactiveObject at line 93
array
__debugInfo()
in
ReactiveObject at line 109
static ReactiveObject
factory(object|array $attributes = [], object|null $parent = null)
in
ReactiveObject at line 117
array
jsonSerialize()
in
ReactiveObject at line 142
static
hasTrait($trait)
in
ReactiveObject at line 150
array
__serialize()
in
ReactiveObject at line 158
__unserialize(array $data)
in
OrderAddAPI at line 15
OrderAddAPI
addCart(array $item)
in
OrderAddAPI at line 31
OrderAddAPI
addDiscount(array $item)
in
OrderAddAPI at line 47
OrderAddAPI
addPayment(array $item)
in
OrderAddAPI at line 65
OrderAddAPI
addData(string $key, string $value, string $label = '')
in
OrderAddAPI at line 90
OrderAddAPI
addLogInfo(array|string $item)
in
OrderAddAPI at line 100
OrderAddAPI
addLogWarning(array|string $item)
in
OrderAddAPI at line 110
OrderAddAPI
addLogDanger(array|string $item)
in
OrderAddAPI at line 120
OrderAddAPI
addLogSuccess(array|string $item)
in
OrderAddAPI at line 131
OrderAddAPI
addLog(array|string $item, string $type = 'i')
in
OrderAPI at line 105
OrderAPI
checkoutEnd(array $payload = [])
Same as checkout, but set checkout_end date in payload for you
in
OrderAPI at line 176
static OrderAPI
create(array $order = [])
Creates empty order object based on orderData
in
OrderAPI at line 190
static OrderAPI
retrieveBySessionOrCreate(string|null $key = null)
If no session exist, it creates a new empty order in API with id and secret, and adds it to session.
in
OrderAPI at line 209
static OrderAPI
retrieveBySession(string|null $key = null)
If no session exist, it creates a new empty order object WITHOUT id or secret.
But; It makes shure session is set when order is saved.
in
OrderAPI at line 297
static protected array|null
getFromCache(string $key)
in
Queryable at line 39
static protected Builder
makeQueryBuilder($appends = [])
in
Queryable at line 99
bool
respectPublishingStatus()
Determine if this object respects publishing statuses when performing queries
in
Queryable at line 111
static Builder
disregardingPublishingStatus(bool $disregarding = true)
Override the publishing status for the model
in
Queryable at line 125
static Builder
field(...$args)
Adds a field that should be retrieved
in
Queryable at line 138
static Builder
fields(...$args)
Sets which fields to retrieve (default: All fields)
in
Queryable at line 151
static Builder
limit(...$args)
Limits the results to $limit amount of hits
in
Queryable at line 166
static Builder
orderBy(...$args)
Sets the field which to order the results by
in
Queryable at line 179
static Builder
raw(...$args)
Performs a raw query, use carefully.
in
Queryable at line 192
static Builder
publishedAt(...$args)
Performs a 'publishedAt' query
in
Queryable at line 210
static Builder
where(...$args)
Performs a 'where' query
If a closure is passed as the only argument, a new query scope will be created. If $value is omitted, $operator is used as the $value, and the $operator will be set to '='.
in
Queryable at line 224
static Builder
whereIn(...$args)
Queries where field exists in the values
in
Queryable at line 242
static Builder
whereNot(...$args)
Performs a 'whereNot' query
If a closure is passed as the only argument, a new query scope will be created. If $value is omitted, $operator is used as the $value, and the $operator will be set to '='.
in
Queryable at line 257
static
whereBetween(...$args)
in
Queryable at line 272
static
whereNotBetween(...$args)
in
Queryable at line 287
static Paginator
paginate(...$args)
Creates a paginated result
in
Queryable at line 303
static mixed
maybeMutatesCache(string $key, bool $shouldCache, Closure $action)
Perform an action and mutate the given key if $shouldCache is true
in
Queryable at line 320
static Builder
maybeCacheResults(string $key, bool $shouldCache)
Cache the results with the given key if $shouldCache is true
in
Queryable at line 336
static Builder
cacheResults(string $key)
Cache the results with the given key
in
Queryable at line 349
static int
count(...$args)
Get the count of items matching the current query
in
Queryable at line 372
static Builder
query(string $query = '*')
in
HasRelation at line 15
string
getRelation()
Gets the relation
in
HasRelation at line 26
int|null
getRelationId()
Gets the relation_id
in
HasRelation at line 39
protected string
getCacheIdentifier(mixed $identifier = null)
Creates a cacheKey
in
HasRelation at line 56
protected
getAllCacheIdentifier()
in
ModelMapper at line 12
protected Closure
getMapper()
at line 93
Order
newFromBuilder(array $attributes = [])
at line 102
int|null
getCustomerIdAttribute(string|int $id)
at line 111
float
getOrderTaxAttribute(string|float|int $tax)
at line 120
float
getOrderCostAttribute(string|float|int $cost)
at line 129
float
getOrderTotalAttribute(string|float|int $total)
at line 138
bool
getAbandonedAttribute(string|int|bool|null $abandoned)
at line 147
bool
getAbandonedReminderSentAttribute(string|int|bool|null $sent)
at line 156
Register
getRegisterAttribute(object|array|null $register)
at line 165
Cart
getCartAttribute(object|array|null $cart = [])
at line 177
Data
getDataAttribute(object|array|null $data = [])
at line 189
Payments
getPaymentsAttribute(object|array|null $payments = null)
at line 201
Checkout
getCheckoutAttribute(object|array|null $checkout = null)
at line 213
DiscountItemCollection
getDiscountsAttribute(array|null $discounts = [])
at line 225
LogItemCollection
getLogAttribute(array|null $log = [])
at line 237
static string
dateTimeNow()
Return the current date and time, formatted as it is stored in the database