summaryrefslogtreecommitdiffstats
path: root/lib/private/Collaboration
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Collaboration')
-rw-r--r--lib/private/Collaboration/Resources/Manager.php48
-rw-r--r--lib/private/Collaboration/Resources/Resource.php40
2 files changed, 12 insertions, 76 deletions
diff --git a/lib/private/Collaboration/Resources/Manager.php b/lib/private/Collaboration/Resources/Manager.php
index d1b84f96283..bfe95a74514 100644
--- a/lib/private/Collaboration/Resources/Manager.php
+++ b/lib/private/Collaboration/Resources/Manager.php
@@ -285,41 +285,23 @@ class Manager implements IManager {
}
/**
- * Get the display name of a resource
+ * Get the rich object data of a resource
*
* @param IResource $resource
- * @return string
+ * @return array
* @since 16.0.0
*/
- public function getName(IResource $resource): string {
- foreach ($this->getProviders() as $provider) {
- if ($provider->getType() === $resource->getType()) {
- try {
- return $provider->getName($resource);
- } catch (ResourceException $e) {
- }
- }
- }
-
- return '';
- }
-
- /**
- *
- * @param IResource $resource
- * @return string
- */
- public function getIconLink(IResource $resource): string {
+ public function getResourceRichObject(IResource $resource): array {
foreach ($this->getProviders() as $provider) {
if ($provider->getType() === $resource->getType()) {
try {
- return $provider->getIconLink($resource);
+ return $provider->getResourceRichObject($resource);
} catch (ResourceException $e) {
}
}
}
- return '';
+ return [];
}
/**
@@ -541,24 +523,4 @@ class Manager implements IManager {
public function getType(): string {
return '';
}
-
- /**
- * Get the link to a resource
- *
- * @param IResource $resource
- * @return string
- * @since 16.0.0
- */
- public function getLink(IResource $resource): string {
- foreach ($this->getProviders() as $provider) {
- if ($provider->getType() === $resource->getType()) {
- try {
- return $provider->getLink($resource);
- } catch (ResourceException $e) {
- }
- }
- }
-
- return '';
- }
}
diff --git a/lib/private/Collaboration/Resources/Resource.php b/lib/private/Collaboration/Resources/Resource.php
index 0a3c003b27c..038f1d6162d 100644
--- a/lib/private/Collaboration/Resources/Resource.php
+++ b/lib/private/Collaboration/Resources/Resource.php
@@ -49,14 +49,8 @@ class Resource implements IResource {
/** @var bool|null */
protected $access;
- /** @var string|null */
- protected $name;
-
- /** @var string|null */
- protected $iconClass;
-
- /** @var string|null */
- protected $link;
+ /** @var array|null */
+ protected $data;
public function __construct(
IManager $manager,
@@ -91,35 +85,15 @@ class Resource implements IResource {
}
/**
- * @return string
+ * @return array
* @since 16.0.0
*/
- public function getName(): string {
- if ($this->name === null) {
- $this->name = $this->manager->getName($this);
- }
-
- return $this->name;
- }
-
- /**
- * @return string
- * @since 16.0.0
- */
- public function getIconLink(): string {
- if ($this->iconClass === null) {
- $this->iconClass = $this->manager->getIconLink($this);
- }
-
- return $this->iconClass;
- }
-
- public function getLink(): string {
- if ($this->link === null) {
- $this->link = $this->manager->getLink($this);
+ public function getRichObject(): array {
+ if ($this->data === null) {
+ $this->data = $this->manager->getResourceRichObject($this);
}
- return $this->link;
+ return $this->data;
}
/**