File tree Expand file tree Collapse file tree 3 files changed +96
-5
lines changed
app/code/Magento/Security Expand file tree Collapse file tree 3 files changed +96
-5
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+
7
+ declare (strict_types=1 );
8
+
9
+ namespace Magento \Security \Api \Data ;
10
+
11
+ /**
12
+ * Interface UserExpirationInterface to be used as a DTO for expires_at property on User model.
13
+ */
14
+ interface UserExpirationInterface
15
+ {
16
+
17
+ const EXPIRES_AT = 'expires_at ' ;
18
+
19
+ const USER_ID = 'user_id ' ;
20
+
21
+ /**
22
+ * `expires_at` getter.
23
+ *
24
+ * @return string
25
+ */
26
+ public function getExpiresAt ();
27
+
28
+ /**
29
+ * `expires_at` setter.
30
+ *
31
+ * @param string $expiresAt
32
+ * @return $this
33
+ */
34
+ public function setExpiresAt ($ expiresAt );
35
+
36
+ /**
37
+ * `user_id` getter.
38
+ *
39
+ * @return string
40
+ */
41
+ public function getUserId ();
42
+
43
+ /**
44
+ * `user_id` setter.
45
+ *
46
+ * @param string $userId
47
+ * @return $this
48
+ */
49
+ public function setUserId ($ userId );
50
+ }
Original file line number Diff line number Diff line change 7
7
8
8
namespace Magento \Security \Model ;
9
9
10
+ use Magento \Security \Api \Data \UserExpirationInterface ;
11
+
10
12
/**
11
13
* Admin User Expiration model.
12
- * @method string getUserId()
13
- * @method \Magento\Security\Model\UserExpiration setUserId($userId)
14
- * @method string getExpiresAt()
15
- * @method \Magento\Security\Model\UserExpiration setExpiresAt($value)
16
14
*/
17
- class UserExpiration extends \Magento \Framework \Model \AbstractModel
15
+ class UserExpiration extends \Magento \Framework \Model \AbstractModel implements UserExpirationInterface
18
16
{
19
17
20
18
/**
@@ -26,4 +24,46 @@ protected function _construct()
26
24
{
27
25
$ this ->_init (\Magento \Security \Model \ResourceModel \UserExpiration::class);
28
26
}
27
+
28
+ /**
29
+ * `expires_at` getter.
30
+ *
31
+ * @return string
32
+ */
33
+ public function getExpiresAt ()
34
+ {
35
+ return $ this ->getData (self ::EXPIRES_AT );
36
+ }
37
+
38
+ /**
39
+ * `expires_at` setter.
40
+ *
41
+ * @param string $expiresAt
42
+ * @return $this
43
+ */
44
+ public function setExpiresAt ($ expiresAt )
45
+ {
46
+ return $ this ->setData (self ::EXPIRES_AT , $ expiresAt );
47
+ }
48
+
49
+ /**
50
+ * `user_id` getter.
51
+ *
52
+ * @return string
53
+ */
54
+ public function getUserId ()
55
+ {
56
+ return $ this ->getData (self ::USER_ID );
57
+ }
58
+
59
+ /**
60
+ * `user_id` setter.
61
+ *
62
+ * @param string $userId
63
+ * @return $this
64
+ */
65
+ public function setUserId ($ userId )
66
+ {
67
+ return $ this ->setData (self ::USER_ID , $ userId );
68
+ }
29
69
}
Original file line number Diff line number Diff line change 18
18
</argument >
19
19
</arguments >
20
20
</type >
21
+ <preference for =" Magento\Security\Api\Data\UserExpirationInterface" type =" Magento\Security\Model\UserExpiration" />
21
22
</config >
You can’t perform that action at this time.
0 commit comments