1 | <?php |
||
25 | class Identity implements Dto, Serializable |
||
26 | { |
||
27 | /** |
||
28 | * @Assert\NotBlank(message="middleware_client.dto.identity.id.must_not_be_blank") |
||
29 | * @Assert\Type(type="string", message="middleware_client.dto.identity.id.must_be_string") |
||
30 | * @var string |
||
31 | */ |
||
32 | public $id; |
||
33 | |||
34 | /** |
||
35 | * @Assert\NotBlank(message="middleware_client.dto.identity.name_id.must_not_be_blank") |
||
36 | * @Assert\Type(type="string", message="middleware_client.dto.identity.name_id.must_be_string") |
||
37 | * @var string |
||
38 | */ |
||
39 | public $nameId; |
||
40 | |||
41 | /** |
||
42 | * @Assert\NotBlank(message="middleware_client.dto.identity.institution.must_not_be_blank") |
||
43 | * @Assert\Type(type="string", message="middleware_client.dto.identity.institution.must_be_string") |
||
44 | * @var string |
||
45 | */ |
||
46 | public $institution; |
||
47 | |||
48 | /** |
||
49 | * @Assert\NotBlank(message="middleware_client.dto.identity.email.must_not_be_blank") |
||
50 | * @Assert\Type(type="string", message="middleware_client.dto.identity.email.must_be_string") |
||
51 | * @var string |
||
52 | */ |
||
53 | public $email; |
||
54 | |||
55 | /** |
||
56 | * @Assert\NotBlank(message="middleware_client.dto.identity.common_name.must_not_be_blank") |
||
57 | * @Assert\Type(type="string", message="middleware_client.dto.identity.common_name.must_be_string") |
||
58 | * @var string |
||
59 | */ |
||
60 | public $commonName; |
||
61 | |||
62 | /** |
||
63 | * @Assert\NotBlank(message="middleware_client.dto.identity.preferred_locale.must_not_be_blank") |
||
64 | * @Assert\Type(type="string", message="middleware_client.dto.identity.preferred_locale.must_be_string") |
||
65 | * @var string |
||
66 | */ |
||
67 | public $preferredLocale; |
||
68 | |||
69 | public static function fromData(array $data) |
||
81 | |||
82 | /** |
||
83 | * Used so that we can serialize the Identity within the SAMLToken, so we can store the token in a session. |
||
84 | * This to support persistent login |
||
85 | * |
||
86 | * @return string |
||
87 | */ |
||
88 | public function serialize() |
||
101 | |||
102 | /** |
||
103 | * Used so that we can unserialize the Identity within the SAMLToken, so that it can be loaded from the session |
||
104 | * for persistent login. |
||
105 | * |
||
106 | * @param string $serialized |
||
107 | */ |
||
108 | public function unserialize($serialized) |
||
119 | |||
120 | /** |
||
121 | * This is a requirement to be able to set the identity as user in the TokenInterface. |
||
122 | * (so we can use it as user in SF) |
||
123 | * |
||
124 | * @return string |
||
125 | */ |
||
126 | public function __toString() |
||
130 | } |
||
131 |