Merge pull request #16400 from nextcloud/bugfix/noid/fixing-addsubtag

addsubtag should push to array
This commit is contained in:
Roeland Jago Douma 2019-07-15 08:45:16 +02:00 committed by GitHub
commit de25e492f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -359,11 +359,16 @@ class IndexDocument implements IIndexDocument, JsonSerializable {
* @return IIndexDocument
*/
final public function addSubTag(string $sub, string $tag): IIndexDocument {
$this->subTags[$sub] = $tag;
if (!array_key_exists($sub, $this->subTags)) {
$this->subTags[$sub] = [];
}
$this->subTags[$sub][] = $tag;
return $this;
}
/**
* Set the list of sub tags assigned to the original document.
*