summaryrefslogtreecommitdiffstats
path: root/lib/private/Accounts/AccountProperty.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Accounts/AccountProperty.php')
-rw-r--r--lib/private/Accounts/AccountProperty.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/private/Accounts/AccountProperty.php b/lib/private/Accounts/AccountProperty.php
index 1a21baf9698..0e6356e9e92 100644
--- a/lib/private/Accounts/AccountProperty.php
+++ b/lib/private/Accounts/AccountProperty.php
@@ -27,6 +27,7 @@ declare(strict_types=1);
*/
namespace OC\Accounts;
+use InvalidArgumentException;
use OCP\Accounts\IAccountManager;
use OCP\Accounts\IAccountProperty;
@@ -42,6 +43,8 @@ class AccountProperty implements IAccountProperty {
private $verified;
/** @var string */
private $verificationData;
+ /** @var string */
+ private $locallyVerified = IAccountManager::NOT_VERIFIED;
public function __construct(string $name, string $value, string $scope, string $verified, string $verificationData) {
$this->name = $name;
@@ -90,7 +93,7 @@ class AccountProperty implements IAccountProperty {
IAccountManager::SCOPE_PRIVATE,
IAccountManager::SCOPE_PUBLISHED
])) {
- throw new \InvalidArgumentException('Invalid scope');
+ throw new InvalidArgumentException('Invalid scope');
}
$this->scope = $newScope;
return $this;
@@ -178,4 +181,20 @@ class AccountProperty implements IAccountProperty {
public function getVerificationData(): string {
return $this->verificationData;
}
+
+ public function setLocallyVerified(string $verified): IAccountProperty {
+ if (!in_array($verified, [
+ IAccountManager::NOT_VERIFIED,
+ IAccountManager::VERIFICATION_IN_PROGRESS,
+ IAccountManager::VERIFIED,
+ ])) {
+ throw new InvalidArgumentException('Provided verification value is invalid');
+ }
+ $this->locallyVerified = $verified;
+ return $this;
+ }
+
+ public function getLocallyVerified(): string {
+ return $this->locallyVerified;
+ }
}