1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
UserCollection.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
5namespace Bitrix\Socialnetwork\Provider\User;
6
7use ArrayIterator;
8use Bitrix\Main\Type\Contract\Arrayable;
9use IteratorAggregate;
10
11class UserCollection implements IteratorAggregate, Arrayable
12{
13 protected array $users = [];
14
15 public function __construct(User ...$users)
16 {
17 $this->users = $users;
18 }
19
20 public function add(User $user): static
21 {
22 $this->users[] = $user;
23
24 return $this;
25 }
26
27 public function getIterator(): ArrayIterator
28 {
29 return new ArrayIterator($this->users);
30 }
31
32 public function toArray(): array
33 {
34 $users = [];
35 foreach ($this->users as $user)
36 {
37 $users[$user->id] = $user->toArray();
38 }
39
40 return $users;
41 }
42}
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$user
Определения mysql_to_pgsql.php:33