Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
buildersectionconnectionfromexternalsection.php
1<?php
2
4
10
12{
16 private array $externalSection;
20 private Section $section;
24 private Connection $connection;
25
26 public function __construct(array $externalSection, Section $section, Connection $connection)
27 {
28 $this->externalSection = $externalSection;
29 $this->section = $section;
30 $this->connection = $connection;
31 }
32
33 public function build()
34 {
35 return (new SectionConnection())
36 ->setVendorSectionId($this->externalSection['id'])
37 ->setConnection($this->connection)
38 ->setLastSyncStatus(Dictionary::SYNC_STATUS['success'])
39 ->setVersionId($this->externalSection['etag'])
40 ->setSection($this->section)
41 ->setOwner($this->section->getOwner())
42 ;
43 }
44}