Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private function lockOrder(Order $order, OrderDto $orderDto, $updatedAt, $latestChanges, ResourceChanges $changes)
- {
- if (!is_null($orderDto->getLockedBy())) {
- if ($this->shouldBeUpdated('lockedBy', $orderDto, $updatedAt, $latestChanges)) {
- $changes->addField('lockedBy', $orderDto->getPreviousValue('lockedBy'), $this->security->getAuthenticatedUser());
- }
- $order->setLockedBy($this->security->getAuthenticatedUser());
- return true;
- } elseif (!is_null($order->getLockedBy())) {
- if ($this->security->getAuthenticatedUser()->getId() == $order->getLockedBy()->getId()) {
- $orderDto->setLockedBy(null);
- if ($this->shouldBeUpdated('lockedBy', $orderDto, $updatedAt, $latestChanges)) {
- $changes->addField('lockedBy', $orderDto->getPreviousValue('lockedBy'), null);
- }
- $order->setLockedBy(null);
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement