Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
account.php
1<?php
2
4
6
7abstract class Account extends AbstractBase
8{
9 public function getProfile() : ?DTO\Profile
10 {
11 $response = $this->getRequest()->send([
12 'methodName' => $this->getMethodName('profile'),
13 'parameters' => []
14 ]);
15
16 if ($response->isSuccess() && $data = $response->fetch())
17 {
18 return
19 (new DTO\Profile())
20 ->setId($data['ID'])
21 ->setPicture($data['PICTURE']['data']['url'] ?? null)
22 ->setLink($data['LINK'])
23 ->setName($data['NAME'])
24 ;
25 }
26
27 return null;
28 }
29}