Automattic\WooCommerce\Internal\PushNotifications\Notifications
StockNotification::to_array
{@inheritDoc}
Extends the parent array with event_type and the trigger-time stock snapshot so both fields survive serialization through the safety-net scheduler and the internal-REST round-trip.
Метод класса: StockNotification{}
Хуков нет.
Возвращает
Массив{type:. string, resource_id: int, event_type: string, stock_quantity_at_trigger: int|null}
Использование
$StockNotification = new StockNotification(); $StockNotification->to_array(): array;
Список изменений
| С версии 10.9.0 | Введена. |
Код StockNotification::to_array() StockNotification::to array WC 10.9.1
public function to_array(): array {
return array_merge(
parent::to_array(),
array(
'event_type' => $this->event_type,
'stock_quantity_at_trigger' => $this->stock_quantity_at_trigger,
)
);
}