OrderManager
class OrderManager implements OrderManagerInterface, BasicEntityManagerInterface
Class OrderManager is injected as alligator.order_manager service. OrderManager handles the logic for managed entity.
Traits
Properties
| protected OrderRepository | $orderRepository | ||
| protected OrderRepository | $repository | ||
| protected OrderEventContainer | $eventContainer |
Methods
No description
No description
No description
OrderManager constructor.
Retrieve reference for provided class and id
No description
Find order by transaction id
No description
No description
No description
Retrieve data for statistics
Retrieve data for statistics
Find all products that user hasn't bought
Find all orders that match provided criteria
Find provided number of finished orders for dashboard
Find all finished orders by currency for dashboard
Remove provided order
No description
Retrieve summary of payment depending on payment type
Update product(product attribute values) quantities(number in stock, total quantity and reserved quantity) based on old and new state of order
Remove order item - called from edit order in backend
Update product(product attribute values) quantities and update order
Change product attribute value for order item
Edit order item, and update quantities
Find order with relationships by id
Retrieve orders in abandoned cart state with pagination
JQGrid function
JQGrid function
JQGrid function
Find order by id
Retrieve number of sales for provided product
Change state of order to confirmed
Get order with custom information - used to send data to Google Analytics
Find order by token
Retrieve summary for order
Create and persist new order with provided currency and locale
Retrieve reference for user that match provided id
Find payment type by id
Retrieve reference for shipping provider
Find all group products in order
Find last unfinished order for provided user
Retrieve pricelist for user. NULL otherwise
No description
Remove provided order
Find all orders in state pending or processing
Find id and erp code of all orders
Find id of all orders
Retrieve logged user. NULL if no user is logged in
Get all unfinished orders that are in state "payment_bank"
Flushes all changes to objects that have been queued up to now to the database
Retrieve id of all orders that are synchronized with erp
Find all orders that match provided ids
Retrieve current session
Details
in JQGridManagerTrait at line 26
mixed
searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)
in JQGridManagerTrait at line 40
mixed
findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)
in JQGridManagerTrait at line 53
mixed
getCountForJQGRID(array|null $searchParams = null, array|null $sortParams = null, array|null $additionalParams = array(), JQGridWrapper|null $jqGridWrapper = null)
at line 67
__construct(OrderRepository $orderRepository, OrderEventContainer $eventContainer)
OrderManager constructor.
at line 77
mixed
saveOrder(Order $order)
at line 90
Order|Proxy|object|null
getReference(int $id, string $class = Order::class)
Retrieve reference for provided class and id
at line 98
mixed
editOrder(Order $order)
at line 110
mixed
findAllOrders(mixed $user)
at line 134
Order|object|null
findOrderByTransId(string $transId)
Find order by transaction id
at line 142
array
findAbandonedCarts()
at line 150
array
findOrdersForReport(array $params)
at line 158
mixed
getDBOrder(Order $order)
at line 166
array
loadGraphData($currency = null)
at line 178
array|null
loadOrderDetailsGraphData(string $date)
Retrieve data for statistics
at line 192
array
loadGraphDataForInterval(string $dateFrom, string $dateTo, string $currency = null)
Retrieve data for statistics
at line 208
array
getBestSellerThatAreNotBoughtByUser(int $userId, int $numberOfProducts, array|null $limitData = null)
Find all products that user hasn't bought
at line 216
mixed
changeOrderState(stdClass $data)
at line 279
OrderEvent
dispatchAfterAddToCartLogicEvent(Order $order)
Dispatch event after add to cart
at line 308
array
findLastOrdersForLiveSale(User $user, int $number)
Find all orders without abandoned carts
at line 325
array
doOrderItemsSearch(int $page, int $offset, int $productId, null $searchParams = null)
Find all orders that match provided criteria
at line 370
array
getOrdersForDashboard(int $number)
Find provided number of finished orders for dashboard
at line 392
array
getOrdersForDashboardByCurrency(string $currency = null, int $number = 5, array $params = null)
Find all finished orders by currency for dashboard
at line 404
bool
deleteOrders(array $ordersArray)
Remove provided order
at line 414
OrderRepository
getOrderRepository()
at line 427
array
getAmountByTypeOfPayment(array|null $searchParams, int|null $userId = null)
Retrieve summary of payment depending on payment type
at line 443
Order
updateQuantities(Order $order, String $oldState = null, array $updateOnlyWithId = array())
Update product(product attribute values) quantities(number in stock, total quantity and reserved quantity) based on old and new state of order
at line 522
Order
editOrderRemoveItem(int $itemId, int $orderId)
Remove order item - called from edit order in backend
at line 578
Order
editOrderCheckoutSuccess(Order $order)
Update product(product attribute values) quantities and update order
at line 623
array|bool
changeOrderItem(stdClass $data)
Change order item
at line 720
OrderItem
changePAV(Order $order, OrderItem $item, mixed $data, mixed $oldQuantity, ProductAttributeValuesRepository $pavRepository)
Change product attribute value for order item
at line 802
Order
editOrderAddItem(Order $order, Product $product, array $additionalData = array())
Edit order item, and update quantities
at line 899
bool
activateCoupon(Order $order)
Active coupon that is cached in session
at line 914
Order
getDBOrderForDetails(int $id)
Find order with relationships by id
at line 928
array
getAbandonedCartsForPagination(int $userId, int $page, int $offset)
Retrieve orders in abandoned cart state with pagination
at line 943
array
getOrdersForPagination(int $userId, int $page, int $offset, bool $hidePending = true)
JQGrid function
at line 959
array
countAbandonedCartsByUserForPagination(int $userId)
JQGrid function
at line 972
array
countOrdersByUserForPagination(int $userId, bool $hidePending = true)
JQGrid function
at line 988
Order
getOrderForSocket(int $id)
Find order by id
at line 1017
mixed
getNumberOfSalesOfProduct(int $productId)
Retrieve number of sales for provided product
at line 1028
Order
confirmOrderByToken(string $token)
Change state of order to confirmed
at line 1047
bool
setOrderCurrency(Order $order)
Update currency and currency ratio for provided order
at line 1059
bool
setOrderLocale(Order $order)
Update locale for provided order
at line 1070
array
getOrderForGoogleAnalytics(int $orderId)
Get order with custom information - used to send data to Google Analytics
at line 1082
Order
getOrderByToken(string $token)
Find order by token
at line 1093
ArrayCollection
getOrdersSummary(int $id)
Retrieve summary for order
at line 1104
mixed
generateNewOrderFromBackend(array $additionalData)
Create and persist new order with provided currency and locale
at line 1115
User
getUserByPk(int $id)
Retrieve reference for user that match provided id
at line 1126
string|null
getPaymentTypeByPk(int $id)
Find payment type by id
at line 1137
ShippingProvider|Proxy|null|object
getShippingByPk(int $id)
Retrieve reference for shipping provider
at line 1156
array
getAllGroupProductsForOrder(int $orderId)
Find all group products in order
at line 1171
Order|null
getLastUnfinishedOrderForUser(User|null $user, string|null $sessionId = null, bool $shouldConvertMoney = true)
Find last unfinished order for provided user
at line 1191
Order
convertOrderToPricelistCurrency(Order $order)
Convert order to pricelist currency
at line 1223
null|string
getUserPriceListCurrency()
Retrieve pricelist for user. NULL otherwise
at line 1231
bool
updateCouponCode(int $orderId, string $code)
at line 1242
bool
deleteDbOrders(array $ordersArray)
Remove provided order
at line 1252
array
getPendingOrders()
Find all orders in state pending or processing
at line 1262
array
getOrderIdErpCodes()
Find id and erp code of all orders
at line 1272
array
getAllOrdersIds()
Find id of all orders
at line 1282
User|null
getLoggedUser()
Retrieve logged user. NULL if no user is logged in
at line 1293
array
getAllUnfinishedBankOrdersBeforeDate(DateTime $currentDate)
Get all unfinished orders that are in state "payment_bank"
at line 1301
saveChanges()
Flushes all changes to objects that have been queued up to now to the database
at line 1311
array
getUnsyncedErpOrderIds()
Retrieve id of all orders that are synchronized with erp
at line 1322
array
getOrdersForIds(array $ids)
Find all orders that match provided ids
at line 1332
mixed
getCurrentSession()
Retrieve current session