Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
base.php
1<?php
3
5
6class Base
7 implements ICmd
8{
10
11 public function cmd($pageType, $fields)
12 {
13 $cmd = Cmd\Factory::create($pageType);
14 $cmd
15 ->setFieldsValues($fields)
16 ->fill();
17
18 if(!($cmd instanceof Cmd\CmdBase))
19 {
20 $cmd
21 ->setPageByType($pageType);
22 }
23
24 return $cmd;
25 }
26 public function batch($pageType, $list)
27 {
28 $batch = new Cmd\Batch();
30
31 foreach ($list as $index=>$row)
32 {
33 $cmd = $this->cmd($pageType, $row);
34
35 $batchItemCollection->addItem(
36 Cmd\Batch\Item::create($cmd)
37 ->setInternalIndex($index));
38 }
39
41
42 return $batch
43 //->setDirectory(Cmd\Batch::DIRECTORY_PAGE)
44 ->setPage(Cmd\Batch::CMD_PAGE)
45 ->setField('cmd', $batchItemCollection->toArray())
46 ->fill();
47 }
48
49 protected function setBatchItemCollection($batchItemCollection)
50 {
51 $this->batchItemCollection = $batchItemCollection;
52 }
53}