1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
reliabilitycollection.php
См. документацию.
1<?php
2
3namespace Sale\Handlers\Delivery\Additional\RusPost\Reliability;
4
5
6use Bitrix\Sale\Internals\EO_Reliability_Collection;
7
12class ReliabilityCollection extends EO_Reliability_Collection
13{
18 public function filterByHashes(array $hashes)
19 {
20 if(empty($hashes))
21 {
22 return $this;
23 }
24
25 $result = new self();
26
28 foreach ($this as $reliability)
29 {
30
31 if(in_array($reliability->getHash(), $hashes))
32 {
33 $result->add($reliability);
34 }
35 }
36
37 return $result;
38 }
39
45 public function saveItems()
46 {
47 $storedCollection = static::$dataClass::query()
48 ->addFilter('HASH', $this->getHashList())
49 ->addSelect('*')
50 ->fetchCollection();
51
53 foreach ($storedCollection as $stored)
54 {
55 if($item = $this->getByPrimary($stored->getHash()))
56 {
57 $stored->setReliability($item->getReliability());
58 $this->removeByPrimary($item->getHash());
59 $this->add($stored);
60 }
61 }
62
63 $this->save();
64 }
65
69 public function setItems(array $items)
70 {
71 foreach ($items as $item)
72 {
73 if($exist = $this->getByPrimary($item->getHash()))
74 {
75 $this->removeByPrimary($item->getHash());
76 }
77
78 $this->add($item);
79 }
80 }
81}
</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
$items
Определения template.php:224