1 | <?php |
||
12 | class Importer implements MigrationInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | protected $config = []; |
||
18 | |||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | private $session = []; |
||
23 | |||
24 | /** |
||
25 | * @var \CIBlockXMLFile |
||
26 | */ |
||
27 | protected $xml; |
||
28 | |||
29 | /** |
||
30 | * @var \CIBlockCMLImport |
||
31 | */ |
||
32 | protected $import; |
||
33 | |||
34 | public function __construct() |
||
52 | |||
53 | /** |
||
54 | * Set type information block |
||
55 | * |
||
56 | * @param string $type |
||
57 | * @return $this |
||
58 | */ |
||
59 | public function setType($type) |
||
64 | |||
65 | /** |
||
66 | * Set file path to import |
||
67 | * |
||
68 | * @param string $path |
||
69 | * @return $this |
||
70 | */ |
||
71 | public function setPath($path) |
||
76 | |||
77 | /** |
||
78 | * Set binding sites for importing information block |
||
79 | * @param array $lids |
||
80 | * @return $this |
||
81 | */ |
||
82 | public function setSites($lids) |
||
87 | |||
88 | /** |
||
89 | * What doing with existing section |
||
90 | * |
||
91 | * @param string $action |
||
92 | * @return $this |
||
93 | */ |
||
94 | public function setActionSection($action) |
||
99 | |||
100 | /** |
||
101 | * What doing with existing element |
||
102 | * |
||
103 | * @param string $action |
||
104 | * @return $this |
||
105 | */ |
||
106 | public function setActionElement($action) |
||
111 | |||
112 | /** |
||
113 | * @inheritdoc |
||
114 | */ |
||
115 | public function execute() |
||
126 | |||
127 | /** |
||
128 | * Read file |
||
129 | * |
||
130 | * @throws ImportException |
||
131 | */ |
||
132 | protected function read() |
||
148 | |||
149 | /** |
||
150 | * Direct import |
||
151 | */ |
||
152 | protected function import() |
||
173 | } |