Merge pull request #1799 from nextcloud/bugfix/noid/participant-primary-key

This commit is contained in:
Julius Härtl
2020-05-06 13:48:11 +02:00
committed by GitHub
13 changed files with 42 additions and 30 deletions

View File

@@ -23,15 +23,13 @@
namespace OCA\Deck\Db;
use OCP\Share\IShare;
class Circle extends RelationalObject {
/** @var \OCA\Circles\Model\Circle */
protected $object;
public function __construct(\OCA\Circles\Model\Circle $circle) {
$primaryKey = IShare::TYPE_CIRCLE . ':' . $circle->getUniqueId();
$primaryKey = $circle->getUniqueId();
parent::__construct($primaryKey, $circle);
}
@@ -40,7 +38,8 @@ class Circle extends RelationalObject {
'uid' => $this->object->getUniqueId(),
'displayname' => $this->object->getName(),
'typeString' => $this->object->getTypeString(),
'circleOwner' => $this->object->getOwner()
'circleOwner' => $this->object->getOwner(),
'type' => 7
];
}
}

View File

@@ -24,18 +24,18 @@
namespace OCA\Deck\Db;
use OCP\IGroup;
use OCP\Share\IShare;
class Group extends RelationalObject {
public function __construct(IGroup $group) {
$primaryKey = IShare::TYPE_GROUP . ':' . $group->getGID();
$primaryKey = $group->getGID();
parent::__construct($primaryKey, $group);
}
public function getObjectSerialization() {
return [
'uid' => $this->object->getGID(),
'displayname' => $this->object->getDisplayName()
'displayname' => $this->object->getDisplayName(),
'type' => 1
];
}
}

View File

@@ -24,18 +24,18 @@
namespace OCA\Deck\Db;
use OCP\IUser;
use OCP\Share\IShare;
class User extends RelationalObject {
public function __construct(IUser $user) {
$primaryKey = IShare::TYPE_USER . ':' . $user->getUID();
$primaryKey = $user->getUID();
parent::__construct($primaryKey, $user);
}
public function getObjectSerialization() {
return [
'uid' => $this->object->getUID(),
'displayname' => $this->object->getDisplayName()
'displayname' => $this->object->getDisplayName(),
'type' => 0
];
}