diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-06-11 16:14:01 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-06-30 00:41:11 +0200 |
commit | d109d4f58198b2ac35d590e59a45f948da23ca8e (patch) | |
tree | 8569a402433cf348d1734d806f0881e4bb8f425a /lib/private/Accounts/AccountPropertyCollection.php | |
parent | 3da9064f9df9b09c4351bb28255afcbc96156a26 (diff) | |
download | nextcloud-server-d109d4f58198b2ac35d590e59a45f948da23ca8e.tar.gz nextcloud-server-d109d4f58198b2ac35d590e59a45f948da23ca8e.zip |
prov api to be able to edit multivalue properties
- adding as usual
- deleting and scope setting via additional endpoint
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/private/Accounts/AccountPropertyCollection.php')
-rw-r--r-- | lib/private/Accounts/AccountPropertyCollection.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/private/Accounts/AccountPropertyCollection.php b/lib/private/Accounts/AccountPropertyCollection.php index 84e10e6a507..eb92536a6a0 100644 --- a/lib/private/Accounts/AccountPropertyCollection.php +++ b/lib/private/Accounts/AccountPropertyCollection.php @@ -27,6 +27,7 @@ declare(strict_types=1); namespace OC\Accounts; use InvalidArgumentException; +use OCP\Accounts\IAccountManager; use OCP\Accounts\IAccountProperty; use OCP\Accounts\IAccountPropertyCollection; @@ -63,6 +64,18 @@ class AccountPropertyCollection implements IAccountPropertyCollection { return $this; } + public function addPropertyWithDefaults(string $value): IAccountPropertyCollection { + $property = new AccountProperty( + $this->collectionName, + $value, + IAccountManager::SCOPE_LOCAL, + IAccountManager::NOT_VERIFIED, + '' + ); + $this->addProperty($property); + return $this; + } + public function removeProperty(IAccountProperty $property): IAccountPropertyCollection { $ref = array_search($property, $this->properties, true); if ($ref !== false) { |