diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2021-06-08 14:25:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-08 14:25:18 +0200 |
commit | 662ab937e0d30947727be1462f8744681fdd2e49 (patch) | |
tree | 3b857453adb11fb00d23d68515b85f6f84cfad6c /lib/public/Accounts/IAccount.php | |
parent | b3cfa1859b14384ae8134e8eb88c171667f77799 (diff) | |
parent | ff2382e5a4a5c29e3e1c948a514c151cae71d402 (diff) | |
download | nextcloud-server-662ab937e0d30947727be1462f8744681fdd2e49.tar.gz nextcloud-server-662ab937e0d30947727be1462f8744681fdd2e49.zip |
Merge pull request #27189 from nextcloud/feat/26866/account-collection-properties
Extend Accounts with multivalue properties (PropertyCollection)
Diffstat (limited to 'lib/public/Accounts/IAccount.php')
-rw-r--r-- | lib/public/Accounts/IAccount.php | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/lib/public/Accounts/IAccount.php b/lib/public/Accounts/IAccount.php index 02c50259b13..72c207537dc 100644 --- a/lib/public/Accounts/IAccount.php +++ b/lib/public/Accounts/IAccount.php @@ -26,6 +26,7 @@ declare(strict_types=1); */ namespace OCP\Accounts; +use Generator; use OCP\IUser; /** @@ -62,16 +63,48 @@ interface IAccount extends \JsonSerializable { /** * Get all properties of an account. Array indices are property names. + * Values from IAccountPropertyCollections are not included in the return + * array. * * @since 15.0.0 - * - * @return IAccountProperty[] + * @deprecated 22.0.0 use getAllProperties() */ public function getProperties(): array; /** + * Get all properties of an account. Array indices are numeric. To get + * the property name, call getName() against the value. + * + * IAccountPropertyCollections are being flattened into an IAccountProperty + * for each value. + * + * @since 22.0.0 + * + * @return Generator<int, IAccountProperty> + */ + public function getAllProperties(): Generator; + + /** + * Set a property collection (multi-value properties) + * + * @since 22.0.0 + */ + public function setPropertyCollection(IAccountPropertyCollection $propertyCollection): IAccount; + + /** + * Returns the requestes propery collection (multi-value properties) + * + * @since 22.0.0 + */ + public function getPropertyCollection(string $propertyCollection): IAccountPropertyCollection; + + /** * Get all properties that match the provided filters for scope and verification status * + * Since 22.0.0 values from IAccountPropertyCollection are included, but also + * as IAccountProperty instances. They for properties of IAccountPropertyCollection are + * suffixed incrementally, i.e. #0, #1 ... #n – the numbers have no further meaning. + * * @since 15.0.0 * * @param string $scope Must be one of the VISIBILITY_ prefixed constants of \OCP\Accounts\IAccountManager |