Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
collection.php
1<?php
2
4
5
7
8class Collection extends Dictionary
9{
10 public const TYPE_GRANT_ALL = 'all';
11 public const TYPE_GRANT_ONE = 'one';
12
13 protected $type = self::TYPE_GRANT_ONE;
14
20 public function __construct(array $gifts, $type)
21 {
22 $this->type = $type;
23
24 parent::__construct($gifts);
25 }
26
27 protected function setGift(Gift $gift, $offset = null)
28 {
29 parent::offsetSet($offset, $gift);
30 }
31
32 public function offsetSet($offset, $value)
33 {
34 $this->setGift($value, $offset);
35 }
36
37 public function getGrantType(): string
38 {
39 return $this->type;
40 }
41}
setGift(Gift $gift, $offset=null)