-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAdminInfoService.php
More file actions
34 lines (27 loc) · 910 Bytes
/
AdminInfoService.php
File metadata and controls
34 lines (27 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/**
* Copyright © . All rights reserved.
* See LICENSE file for license details.
*/
declare(strict_types=1);
namespace OxidEsales\ExamplesModule\ApiEntrypoint\AdminInfo\Service;
use OxidEsales\EshopCommunity\Internal\Transition\Adapter\ShopAdapterInterface;
use OxidEsales\ExamplesModule\ApiEntrypoint\AdminInfo\DataObject\AdminInfo;
use OxidEsales\ExamplesModule\Core\Module as ModuleCore;
readonly class AdminInfoService implements AdminInfoServiceInterface
{
public function __construct(
private ShopAdapterInterface $shopAdapter,
) {
}
public function getAdminInfo(string $username): AdminInfo
{
$greetingPattern = $this->shopAdapter->translateString(
ModuleCore::ADMIN_HELLO_LANGUAGE_CONST
);
return new AdminInfo(
email: $username,
greeting: sprintf($greetingPattern, $username),
);
}
}