Вот мой текущий FlowAction:
Код: Выделить всё
class SameDayMailAction extends FlowAction
{
...
public function requirements(): array
{
return [OrderAware::class];
}
...
public function handleFlow(StorableFlow $flow): void
{
if (!$flow->hasStore(OrderAware::ORDER)) {
$this->logger->error(json_encode($flow->getStore(OrderAware::ORDER)));
return;
}
$order = $flow->getStore(OrderAware::ORDER);
$orderId = $flow->getStore(OrderAware::ORDER_ID);
$this->logger->debug('orderid' . $orderId);
$currentDate = (new DateTime())->format('Y-m-d');
$orderDate = $order->getOrderDate()->format('Y-m-d');
if ($currentDate !== $orderDate) {
return;
}
$this->samedayRepository->create([[
'id' => Uuid::randomHex(),
'orderId' => $orderId,
'clicked' => false
]], $flow->getContext());
}
}
Будем очень признательны за любые советы о том, как правильно увлажнять StorableFlow! Заранее спасибо.
Подробнее здесь: https://stackoverflow.com/questions/791 ... -with-data
Мобильная версия