Fix primary key usage with different types
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -24,13 +24,15 @@
|
||||
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 = $circle->getUniqueId();
|
||||
$primaryKey = IShare::TYPE_CIRCLE . ':' . $circle->getUniqueId();
|
||||
parent::__construct($primaryKey, $circle);
|
||||
}
|
||||
|
||||
@@ -42,4 +44,4 @@ class Circle extends RelationalObject {
|
||||
'circleOwner' => $this->object->getOwner()
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,11 +24,12 @@
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
use OCP\IGroup;
|
||||
use OCP\Share\IShare;
|
||||
|
||||
class Group extends RelationalObject {
|
||||
|
||||
public function __construct(IGroup $group) {
|
||||
$primaryKey = $group->getGID();
|
||||
$primaryKey = IShare::TYPE_GROUP . ':' . $group->getGID();
|
||||
parent::__construct($primaryKey, $group);
|
||||
}
|
||||
|
||||
@@ -38,4 +39,4 @@ class Group extends RelationalObject {
|
||||
'displayname' => $this->object->getDisplayName()
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,11 +24,12 @@
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
use OCP\IUser;
|
||||
use OCP\Share\IShare;
|
||||
|
||||
class User extends RelationalObject {
|
||||
|
||||
public function __construct(IUser $user) {
|
||||
$primaryKey = $user->getUID();
|
||||
$primaryKey = IShare::TYPE_USER . ':' . $user->getUID();
|
||||
parent::__construct($primaryKey, $user);
|
||||
}
|
||||
|
||||
@@ -46,4 +47,4 @@ class User extends RelationalObject {
|
||||
public function getDisplayName() {
|
||||
return $this->object->getDisplayName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user