-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathMapper.php
More file actions
38 lines (35 loc) · 1.03 KB
/
Mapper.php
File metadata and controls
38 lines (35 loc) · 1.03 KB
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
35
36
37
38
<?php declare(strict_types=1);
namespace App\Collaboration\Cart\Persistence;
use App\Collaboration\Cart\Persistence\Values\CartSession;
use Ibexa\Collaboration\Persistence\Session\Inner\MapperInterface;
use Ibexa\Collaboration\Persistence\Values\AbstractSession;
/**
* @phpstan-type TRow array{
* id: int,
* token: string,
* owner_id: int,
* is_active: bool,
* has_public_link: bool,
* created_at: \DateTimeImmutable,
* updated_at: \DateTimeImmutable,
* cart_cart_identifier: string,
* }
*
* @template-implements \Ibexa\Collaboration\Persistence\Session\Inner\MapperInterface<TRow>
*/
final class Mapper implements MapperInterface
{
public function extractFromRow(array $row): AbstractSession
{
return new CartSession(
$row['id'],
$row['cart_cart_identifier'],
$row['token'],
$row['owner_id'],
$row['is_active'],
$row['has_public_link'],
$row['created_at'],
$row['updated_at']
);
}
}