Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
collection.php
1
<?php
2
3
namespace
Bitrix\Location\Entity\Location
;
4
5
use
Bitrix\Location\Entity\Location
;
6
use
Bitrix\Main\ArgumentTypeException
;
7
use
Bitrix\Main\Result
;
8
14
class
Collection
extends
\Bitrix\Location\Entity\Generic\Collection
15
{
17
protected
$items
= [];
18
19
public
function
addItem
($location): int
20
{
21
if
(!($location instanceof
Location
))
22
{
23
throw
new
ArgumentTypeException
(
'location must be the instance of Location'
);
24
}
25
26
return
parent::addItem($location);
27
}
28
32
public
function
save
():
Result
33
{
34
$result =
new
Result
();
35
36
foreach
($this->items as $location)
37
{
38
$res = $location->save();
39
40
if
(!$res->isSuccess())
41
{
42
$result->addErrors($res->getErrors());
43
}
44
}
45
46
return
$result;
47
}
48
}
Bitrix\Location\Entity\Generic\Collection
Definition
collection.php:12
Bitrix\Location\Entity\Location\Collection
Definition
collection.php:15
Bitrix\Location\Entity\Location\Collection\$items
$items
Definition
collection.php:17
Bitrix\Location\Entity\Location\Collection\addItem
addItem($location)
Definition
collection.php:19
Bitrix\Location\Entity\Location\Collection\save
save()
Definition
collection.php:32
Bitrix\Location\Entity\Location
Definition
location.php:20
Bitrix\Main\ArgumentTypeException
Definition
exception.php:114
Bitrix\Main\ORM\Data\Result
Definition
result.php:16
Bitrix\Main\Result
Definition
result.php:14
Bitrix\Location\Entity\Location
Definition
collection.php:3
modules
location
lib
entity
location
collection.php
Создано системой
1.10.0