Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
pool.php
1<?php
3
7
13{
18 public function getItem(string $index)
19 {
20 $result = parent::getItem($index);
21
22 try
23 {
24 $result = Json::decode($result);
25 $result = Location::fromArray($result);
26 }
27 catch (\Exception $e)
28 {
29 $result = null;
30 }
31
32 return $result;
33 }
34
35 public function addItem(string $index, $location): void
36 {
37 if(!($location instanceof Location))
38 {
39 throw new ArgumentTypeException('location must be type of Location');
40 }
41
42 parent::addItem(
43 $index, Json::encode(
44 $location->toArray()
45 )
46 );
47 }
48}
static fromArray(array $location)
Definition location.php:550
addItem(string $index, $location)
Definition pool.php:35