@@ -37,60 +37,60 @@ |
||
37 | 37 | |
38 | 38 | class ShareRequest extends PermissionEntity implements \JsonSerializable { |
39 | 39 | |
40 | - protected |
|
41 | - $itemId, |
|
42 | - $itemGuid, |
|
43 | - $targetUserId, |
|
44 | - $targetVaultId, |
|
45 | - $targetVaultGuid, |
|
46 | - $sharedKey, |
|
47 | - $permissions, |
|
48 | - $created, |
|
40 | + protected |
|
41 | + $itemId, |
|
42 | + $itemGuid, |
|
43 | + $targetUserId, |
|
44 | + $targetVaultId, |
|
45 | + $targetVaultGuid, |
|
46 | + $sharedKey, |
|
47 | + $permissions, |
|
48 | + $created, |
|
49 | 49 | $fromUserId; |
50 | 50 | |
51 | - public function __construct() { |
|
52 | - // add types in constructor |
|
53 | - $this->addType('itemId', 'integer'); |
|
54 | - $this->addType('vaultId', 'integer'); |
|
55 | - $this->addType('permissions', 'integer'); |
|
51 | + public function __construct() { |
|
52 | + // add types in constructor |
|
53 | + $this->addType('itemId', 'integer'); |
|
54 | + $this->addType('vaultId', 'integer'); |
|
55 | + $this->addType('permissions', 'integer'); |
|
56 | 56 | $this->addType('created', 'integer'); |
57 | 57 | $this->addType('targetVaultId', 'integer'); |
58 | - } |
|
58 | + } |
|
59 | 59 | |
60 | - /** |
|
61 | - * Specify data which should be serialized to JSON |
|
62 | - * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
|
63 | - * @return mixed data which can be serialized by <b>json_encode</b>, |
|
64 | - * which is a value of any type other than a resource. |
|
65 | - * @since 5.4.0 |
|
66 | - */ |
|
67 | - function jsonSerialize() |
|
68 | - { |
|
69 | - return [ |
|
70 | - 'req_id' => $this->getId(), |
|
71 | - 'item_id' => $this->getItemId(), |
|
72 | - 'item_guid' => $this->getItemGuid(), |
|
73 | - 'target_user_id' => $this->getTargetUserId(), |
|
74 | - 'target_vault_id' => $this->getTargetVaultId(), |
|
75 | - 'target_vault_guid' => $this->getTargetVaultGuid(), |
|
76 | - 'from_user_id' => $this->getFromUserId(), |
|
77 | - 'shared_key' => $this->getSharedKey(), |
|
78 | - 'permissions' => $this->getPermissions(), |
|
79 | - 'created' => $this->getCreated(), |
|
80 | - ]; |
|
81 | - } |
|
60 | + /** |
|
61 | + * Specify data which should be serialized to JSON |
|
62 | + * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
|
63 | + * @return mixed data which can be serialized by <b>json_encode</b>, |
|
64 | + * which is a value of any type other than a resource. |
|
65 | + * @since 5.4.0 |
|
66 | + */ |
|
67 | + function jsonSerialize() |
|
68 | + { |
|
69 | + return [ |
|
70 | + 'req_id' => $this->getId(), |
|
71 | + 'item_id' => $this->getItemId(), |
|
72 | + 'item_guid' => $this->getItemGuid(), |
|
73 | + 'target_user_id' => $this->getTargetUserId(), |
|
74 | + 'target_vault_id' => $this->getTargetVaultId(), |
|
75 | + 'target_vault_guid' => $this->getTargetVaultGuid(), |
|
76 | + 'from_user_id' => $this->getFromUserId(), |
|
77 | + 'shared_key' => $this->getSharedKey(), |
|
78 | + 'permissions' => $this->getPermissions(), |
|
79 | + 'created' => $this->getCreated(), |
|
80 | + ]; |
|
81 | + } |
|
82 | 82 | |
83 | - function asACLJson(){ |
|
84 | - return [ |
|
85 | - 'item_id' => $this->getItemId(), |
|
86 | - 'item_guid' => $this->getItemGuid(), |
|
87 | - 'user_id' => $this->getTargetUserId(), |
|
88 | - 'created' => $this->getCreated(), |
|
89 | - 'permissions' => $this->getPermissions(), |
|
90 | - 'vault_id' => $this->getTargetVaultId(), |
|
91 | - 'vault_guid' => $this->getTargetVaultGuid(), |
|
92 | - 'shared_key' => $this->getSharedKey(), |
|
93 | - 'pending' => true, |
|
94 | - ]; |
|
95 | - } |
|
83 | + function asACLJson(){ |
|
84 | + return [ |
|
85 | + 'item_id' => $this->getItemId(), |
|
86 | + 'item_guid' => $this->getItemGuid(), |
|
87 | + 'user_id' => $this->getTargetUserId(), |
|
88 | + 'created' => $this->getCreated(), |
|
89 | + 'permissions' => $this->getPermissions(), |
|
90 | + 'vault_id' => $this->getTargetVaultId(), |
|
91 | + 'vault_guid' => $this->getTargetVaultGuid(), |
|
92 | + 'shared_key' => $this->getSharedKey(), |
|
93 | + 'pending' => true, |
|
94 | + ]; |
|
95 | + } |
|
96 | 96 | } |
97 | 97 | \ No newline at end of file |