@@ -32,104 +32,104 @@ |
||
32 | 32 | use Sabre\DAVACL\IACL; |
33 | 33 | |
34 | 34 | class Card implements ICard, IACL { |
35 | - use ACLTrait; |
|
36 | - |
|
37 | - /** @var RecentContact */ |
|
38 | - private $contact; |
|
39 | - |
|
40 | - /** @var string */ |
|
41 | - private $principal; |
|
42 | - |
|
43 | - /** @var array */ |
|
44 | - private $acls; |
|
45 | - |
|
46 | - public function __construct(RecentContact $contact, string $principal, array $acls) { |
|
47 | - $this->contact = $contact; |
|
48 | - $this->principal = $principal; |
|
49 | - $this->acls = $acls; |
|
50 | - } |
|
51 | - |
|
52 | - /** |
|
53 | - * @inheritDoc |
|
54 | - */ |
|
55 | - public function getOwner(): ?string { |
|
56 | - return $this->principal; |
|
57 | - } |
|
58 | - |
|
59 | - /** |
|
60 | - * @inheritDoc |
|
61 | - */ |
|
62 | - public function getACL(): array { |
|
63 | - return $this->acls; |
|
64 | - } |
|
65 | - |
|
66 | - /** |
|
67 | - * @inheritDoc |
|
68 | - */ |
|
69 | - public function setAcls(array $acls): void { |
|
70 | - throw new NotImplemented(); |
|
71 | - } |
|
72 | - |
|
73 | - /** |
|
74 | - * @inheritDoc |
|
75 | - */ |
|
76 | - public function put($data): ?string { |
|
77 | - throw new NotImplemented(); |
|
78 | - } |
|
79 | - |
|
80 | - /** |
|
81 | - * @inheritDoc |
|
82 | - */ |
|
83 | - public function get() { |
|
84 | - return $this->contact->getCard(); |
|
85 | - } |
|
86 | - |
|
87 | - /** |
|
88 | - * @inheritDoc |
|
89 | - */ |
|
90 | - public function getContentType(): ?string { |
|
91 | - return 'text/vcard; charset=utf-8'; |
|
92 | - } |
|
93 | - |
|
94 | - /** |
|
95 | - * @inheritDoc |
|
96 | - */ |
|
97 | - public function getETag(): ?string { |
|
98 | - return '"' . md5((string) $this->getLastModified()) . '"'; |
|
99 | - } |
|
100 | - |
|
101 | - /** |
|
102 | - * @inheritDoc |
|
103 | - */ |
|
104 | - public function getSize(): int { |
|
105 | - throw new NotImplemented(); |
|
106 | - } |
|
107 | - |
|
108 | - /** |
|
109 | - * @inheritDoc |
|
110 | - */ |
|
111 | - public function delete(): void { |
|
112 | - throw new NotImplemented(); |
|
113 | - } |
|
114 | - |
|
115 | - /** |
|
116 | - * @inheritDoc |
|
117 | - */ |
|
118 | - public function getName(): string { |
|
119 | - return (string) $this->contact->getId(); |
|
120 | - } |
|
121 | - |
|
122 | - /** |
|
123 | - * @inheritDoc |
|
124 | - */ |
|
125 | - public function setName($name): void { |
|
126 | - throw new NotImplemented(); |
|
127 | - } |
|
128 | - |
|
129 | - /** |
|
130 | - * @inheritDoc |
|
131 | - */ |
|
132 | - public function getLastModified(): ?int { |
|
133 | - return $this->contact->getLastContact(); |
|
134 | - } |
|
35 | + use ACLTrait; |
|
36 | + |
|
37 | + /** @var RecentContact */ |
|
38 | + private $contact; |
|
39 | + |
|
40 | + /** @var string */ |
|
41 | + private $principal; |
|
42 | + |
|
43 | + /** @var array */ |
|
44 | + private $acls; |
|
45 | + |
|
46 | + public function __construct(RecentContact $contact, string $principal, array $acls) { |
|
47 | + $this->contact = $contact; |
|
48 | + $this->principal = $principal; |
|
49 | + $this->acls = $acls; |
|
50 | + } |
|
51 | + |
|
52 | + /** |
|
53 | + * @inheritDoc |
|
54 | + */ |
|
55 | + public function getOwner(): ?string { |
|
56 | + return $this->principal; |
|
57 | + } |
|
58 | + |
|
59 | + /** |
|
60 | + * @inheritDoc |
|
61 | + */ |
|
62 | + public function getACL(): array { |
|
63 | + return $this->acls; |
|
64 | + } |
|
65 | + |
|
66 | + /** |
|
67 | + * @inheritDoc |
|
68 | + */ |
|
69 | + public function setAcls(array $acls): void { |
|
70 | + throw new NotImplemented(); |
|
71 | + } |
|
72 | + |
|
73 | + /** |
|
74 | + * @inheritDoc |
|
75 | + */ |
|
76 | + public function put($data): ?string { |
|
77 | + throw new NotImplemented(); |
|
78 | + } |
|
79 | + |
|
80 | + /** |
|
81 | + * @inheritDoc |
|
82 | + */ |
|
83 | + public function get() { |
|
84 | + return $this->contact->getCard(); |
|
85 | + } |
|
86 | + |
|
87 | + /** |
|
88 | + * @inheritDoc |
|
89 | + */ |
|
90 | + public function getContentType(): ?string { |
|
91 | + return 'text/vcard; charset=utf-8'; |
|
92 | + } |
|
93 | + |
|
94 | + /** |
|
95 | + * @inheritDoc |
|
96 | + */ |
|
97 | + public function getETag(): ?string { |
|
98 | + return '"' . md5((string) $this->getLastModified()) . '"'; |
|
99 | + } |
|
100 | + |
|
101 | + /** |
|
102 | + * @inheritDoc |
|
103 | + */ |
|
104 | + public function getSize(): int { |
|
105 | + throw new NotImplemented(); |
|
106 | + } |
|
107 | + |
|
108 | + /** |
|
109 | + * @inheritDoc |
|
110 | + */ |
|
111 | + public function delete(): void { |
|
112 | + throw new NotImplemented(); |
|
113 | + } |
|
114 | + |
|
115 | + /** |
|
116 | + * @inheritDoc |
|
117 | + */ |
|
118 | + public function getName(): string { |
|
119 | + return (string) $this->contact->getId(); |
|
120 | + } |
|
121 | + |
|
122 | + /** |
|
123 | + * @inheritDoc |
|
124 | + */ |
|
125 | + public function setName($name): void { |
|
126 | + throw new NotImplemented(); |
|
127 | + } |
|
128 | + |
|
129 | + /** |
|
130 | + * @inheritDoc |
|
131 | + */ |
|
132 | + public function getLastModified(): ?int { |
|
133 | + return $this->contact->getLastContact(); |
|
134 | + } |
|
135 | 135 | } |