1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
TaskCollection.php
См. документацию.
1<?php
2
4
9use Bitrix\Tasks\Provider\TaskList;
10use Bitrix\Tasks\Provider\TaskQuery;
11
17{
18 public static function getRestEntityName(): string
19 {
20 return 'tasks';
21 }
22
23 public static function initByDBResult(\CDBResult $result): self
24 {
25 $taskCollection = new static();
26
27 while ($row = $result->Fetch())
28 {
29 $taskCollection[] = TaskItem::initByRow($row);
30 }
31
32 return $taskCollection;
33 }
34
35 public static function getByIds(array $ids, ?Context $context = null): self
36 {
37 $taskCollection = new static();
38
39 if (empty($ids) || !Loader::includeModule('tasks'))
40 {
41 return $taskCollection->setContext($context);
42 }
43
44 $context = $context ?? Locator::getContext();
45 $taskQuery = new TaskQuery($context->getUserId());
46 $taskQuery
47 ->setSelect(\Bitrix\Im\V2\Link\Task\TaskCollection::SELECT_FIELDS)
48 ->setWhere(['=ID' => $ids])
49 ;
50 $rows = (new TaskList())->getList($taskQuery);
51
52 foreach ($rows as $row)
53 {
54 $taskCollection[] = TaskItem::initByRow($row);
55 }
56
57 return $taskCollection;
58 }
59}
static getByIds(array $ids, ?Context $context=null)
Определения TaskCollection.php:35
static initByDBResult(\CDBResult $result)
Определения TaskCollection.php:23
static initByRow(array $row)
Определения TaskItem.php:76
Определения loader.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$context
Определения csv_new_setup.php:223
Определения ActionUuid.php:3
Определения culture.php:9
$rows
Определения options.php:264