Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
importpattern.php
1<?php
3
5
6abstract class ImportPattern
7{
12 abstract public function parse(array $rawData);
13
18 abstract protected function convert(array $items);
19
24 abstract protected function import(array $items);
25
30 abstract protected function logger(array $items);
31
36 public function process(array $rawData)
37 {
39 $r = $this->parse($rawData);
40 if(!$r->isSuccess())
41 return $r;
42
43 $documents = $r->getData();
44 $r = $this->convert($documents);
45 if(!$r->isSuccess())
46 return $r;
47
48 $entityItems = $r->getData();
49 $r = $this->import($entityItems);
50
51 $this->logger($entityItems);
52
53 return $r;
54 }
55}