Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
result.php
1<?
2
3namespace Bitrix\Seo\LeadAds;
4
7
8class Result extends Main\Result
9{
11 protected $id;
12
14 protected $dateCreate;
15
18
25 public function setData(array $data)
26 {
27 $this->data = array();
28 $this->currentIterationNumber = 0;
29
30 foreach ($data as $item)
31 {
32 if (!isset($item['NAME']) || !$item['NAME'])
33 {
34 continue;
35 }
36
37 if (!isset($item['VALUES']) || !is_array($item['VALUES']) || !$item['VALUES'])
38 {
39 continue;
40 }
41
42 $this->addFieldValues($item['NAME'], $item['VALUES']);
43 }
44 }
45
52 public function addFieldValues($name, array $values)
53 {
54 $this->data[] = array(
55 'NAME' => $name,
56 'VALUES' => $values
57 );
58 }
59
65 public function getId()
66 {
67 return $this->id;
68 }
69
75 public function setId($id)
76 {
77 $this->id = $id;
78 }
79
85 public function getDateCreate()
86 {
87 return $this->dateCreate;
88 }
89
95 public function setDateCreate(DateTime $dateCreate)
96 {
97 $this->dateCreate = $dateCreate;
98 }
99
105 public function fetch()
106 {
107 if (!isset($this->data[$this->currentIterationNumber]))
108 {
109 return null;
110 }
111
112 $row = $this->data[$this->currentIterationNumber];
113 $this->currentIterationNumber++;
114
115 return $row;
116 }
117}
addFieldValues($name, array $values)
Definition result.php:52
setData(array $data)
Definition result.php:25
setDateCreate(DateTime $dateCreate)
Definition result.php:95