Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
finder.php
1<?php
2
4
10
16final class Finder
17{
18 protected $requester;
19 protected $converter;
20
27 {
28 $this->requester = $requester;
29 $this->converter = $converter;
30 }
31
37 public function find(array $fields)
38 {
39 $rawData = $this->requester->request($fields);
40
41 if (
42 is_array($rawData)
43 && isset($rawData['status']) && $rawData['status'] !== 'OK'
44 && isset($rawData['error_message']) && $rawData['error_message'] <> ''
45 )
46 {
47 throw new RuntimeException($rawData['error_message'], ErrorCodes::FINDER_ERROR);
48 }
49
50 return $this->converter !== null ? $this->converter->convert($rawData) : $rawData;
51 }
52}
__construct(BaseRequester $requester, BaseConverter $converter=null)
Definition finder.php:26