1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
sourcerepository.php
См. документацию.
1<?php
2
3namespace Bitrix\Location\Repository;
4
5use Bitrix\Location\Entity\Source;
6use Bitrix\Location\Model\SourceTable;
7
14{
16 private $ormConverter;
17
22 public function __construct(Source\OrmConverter $ormConverter)
23 {
24 $this->ormConverter = $ormConverter;
25 }
26
33 public function findAll(): array
34 {
35 $result = [];
36
37 $queryResult = SourceTable::getList();
38
39 while ($ormSource = $queryResult->fetchObject())
40 {
41 $result[] = $this->ormConverter->convertFromOrm($ormSource);
42 }
43
44 return $result;
45 }
46
54 public function findByCode(string $code): ?Source
55 {
56 $result = null;
57
58 $ormSource = SourceTable::getList(
59 [
60 'filter' => [
61 '=CODE' => $code
62 ],
63 'limit' => 1,
64 ]
65 )->fetchObject();
66
67 if (!$ormSource)
68 {
69 return null;
70 }
71
72 return $this->ormConverter->convertFromOrm($ormSource);
73 }
74
82 public function save(Source $source)
83 {
84 return $this->ormConverter->convertToOrm($source)->save();
85 }
86}
__construct(Source\OrmConverter $ormConverter)
Определения sourcerepository.php:22
</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
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195