1 | <?php |
||
12 | class Importer implements ActionInterface |
||
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() |
||
51 | |||
52 | /** |
||
53 | * Set type information block |
||
54 | * |
||
55 | * @param string $type |
||
56 | * @return $this |
||
57 | */ |
||
58 | public function setType($type) |
||
63 | |||
64 | /** |
||
65 | * Set file path to import |
||
66 | * |
||
67 | * @param string $path |
||
68 | * @return $this |
||
69 | */ |
||
70 | public function setPath($path) |
||
75 | |||
76 | /** |
||
77 | * Set binding sites for importing information block |
||
78 | * @param array $lids |
||
79 | * @return $this |
||
80 | */ |
||
81 | public function setSites($lids) |
||
86 | |||
87 | /** |
||
88 | * What doing with existing section |
||
89 | * |
||
90 | * @param string $action |
||
91 | * @return $this |
||
92 | */ |
||
93 | public function setActionSection($action) |
||
98 | |||
99 | /** |
||
100 | * What doing with existing element |
||
101 | * |
||
102 | * @param string $action |
||
103 | * @return $this |
||
104 | */ |
||
105 | public function setActionElement($action) |
||
110 | |||
111 | /** |
||
112 | * @inheritdoc |
||
113 | */ |
||
114 | public function execute() |
||
127 | |||
128 | /** |
||
129 | * Read file |
||
130 | * |
||
131 | * @throws ImportException |
||
132 | */ |
||
133 | protected function read() |
||
149 | |||
150 | /** |
||
151 | * Direct import |
||
152 | */ |
||
153 | protected function import() |
||
174 | } |