public function TimestampEventSubscriber::onPlaceTransition in Commerce Core 8.2
Sets the order's placed timestamp.
Parameters
\Drupal\state_machine\Event\WorkflowTransitionEvent $event: The transition event.
File
- modules/
order/ src/ EventSubscriber/ TimestampEventSubscriber.php, line 45
Class
Namespace
Drupal\commerce_order\EventSubscriberCode
public function onPlaceTransition(WorkflowTransitionEvent $event) {
/** @var \Drupal\commerce_order\Entity\OrderInterface $order */
$order = $event
->getEntity();
if (empty($order
->getPlacedTime())) {
$order
->setPlacedTime($this->time
->getRequestTime());
}
}