- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/timeline/deliverycontroller.php
- Класс: Bitrix\Crm\Timeline\DeliveryController
- Вызов: DeliveryController::createShipmentMessage
public function createShipmentMessage(array $messageData, Shipment $shipment): ?int
{
$bindings = TimelineBindingsMaker::makeByShipment($shipment);
$id = DeliveryEntry::create([
'ENTITY_TYPE_ID' => \CCrmOwnerType::OrderShipment,
'ENTITY_ID' => $shipment->getId(),
'AUTHOR_ID' => $this->getShipmentResponsibleId($shipment),
'SETTINGS' => [
'FIELDS' => [
'MESSAGE_DATA' => $messageData,
'DELIVERY_SERVICE' =>
$shipment->getDelivery()
? $this->makeDeliveryService($shipment->getDelivery())
: []
,
],
],
'BINDINGS' => $bindings,
]);
if (!$id)
{
return null;
}
$this->sendPullEventOnAddForBindings($id, $bindings);
return $id;
}