Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
tasksuiteassembler.php
1<?php
3
8
10{
16 public static function toDTO(HttpRequest $request)
17 {
18
19 $userTasks = explode(",", $request->get('tasks'));
20 $identificator = $request->get('identificator');
21 $tasks = [];
22 $defaults = PoolDefaultsAssembler::toDTO($request);
23
24 foreach ($userTasks as $task)
25 {
26 $task = trim($task);
27 if(empty($task))
28 {
29 continue;
30 }
31 $newTask = new Task();
32
33 $inputValue = new InputValue();
34 $inputValue->setIdentificator($identificator);
35 $inputValue->setValue(trim($task));
36
37 $newTask->setPoolId($request->get('id'));
38 $newTask->setInputValues($inputValue);
39 $newTask->setOverlap($defaults->getOverlapForNewTasks());
40
41 $tasks[] = $newTask;
42 }
43
44 $taskSuite = new TaskSuite();
45 $taskSuite->setPoolId($request->get('id'));
46 $taskSuite->setTasks($tasks);
47
48 return $taskSuite;
49 }
50}