• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LibreSign / libresign / 20621495436

31 Dec 2025 02:59PM UTC coverage: 44.647%. First build
20621495436

Pull #6256

github

web-flow
Merge 4343635f1 into 27812ed76
Pull Request #6256: feat: add dashboard pending signatures widget

57 of 239 new or added lines in 16 files covered. (23.85%)

6618 of 14823 relevant lines covered (44.65%)

5.05 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/Db/UserElement.php
1
<?php
2

3
declare(strict_types=1);
4
/**
5
 * SPDX-FileCopyrightText: 2020-2024 LibreCode coop and contributors
6
 * SPDX-License-Identifier: AGPL-3.0-or-later
7
 */
8

9
namespace OCA\Libresign\Db;
10

11
use OCP\AppFramework\Db\Entity;
12
use OCP\DB\Types;
13

14
/**
15
 * @method void setId(int $id)
16
 * @method int getId()
17
 * @method void setType(string $type)
18
 * @method string getType()
19
 * @method void setNodeId(int $nodeId)
20
 * @method int getNodeId()
21
 * @method void setUserId(string $userId)
22
 * @method void setStarred(int $starred)
23
 * @method int getStarred()
24
 * @method ?\DateTime getCreatedAt()
25
 * @method void setMetadata(array $metadata)
26
 * @method ?array getMetadata()
27
 */
28
class UserElement extends Entity {
29
        public string $type = '';
30
        protected int $nodeId = 0;
31
        protected string $userId = '';
32
        public bool $starred = false;
33
        public ?\DateTime $createdAt = null;
34
        protected ?array $metadata = null;
35
        /** @var ?array{url: string, nodeId: non-negative-int} */
36
        public ?array $file = null;
37
        public function __construct() {
38
                $this->addType('id', Types::INTEGER);
×
39
                $this->addType('type', Types::STRING);
×
NEW
40
                $this->addType('nodeId', Types::INTEGER);
×
41
                $this->addType('userId', Types::STRING);
×
42
                $this->addType('starred', Types::INTEGER);
×
43
                $this->addType('createdAt', Types::DATETIME);
×
44
                $this->addType('metadata', Types::JSON);
×
45
        }
46

47
        public function isDeletedAccount(): bool {
48
                $metadata = $this->getMetadata();
×
49
                return isset($metadata['deleted_account']);
×
50
        }
51

52
        public function getUserId(): string {
53
                $metadata = $this->getMetadata();
×
54
                return $metadata['deleted_account']['account'] ?? $this->userId;
×
55
        }
56

57
        /**
58
         * @param \DateTime|string $createdAt
59
         */
60
        public function setCreatedAt($createdAt): void {
61
                if (!$createdAt instanceof \DateTime) {
×
62
                        $createdAt = new \DateTime($createdAt, new \DateTimeZone('UTC'));
×
63
                }
64
                $this->createdAt = $createdAt;
×
65
                $this->markFieldUpdated('createdAt');
×
66
        }
67
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc