Update docs

Signed-off-by: Sergey Shliakhov <husband.sergey@gmail.com>

fix: conflicts
This commit is contained in:
Sergey Shliakhov
2020-05-25 09:46:57 +02:00
committed by Julius Härtl
parent eb8a321637
commit fc9fa5dc25
7 changed files with 107 additions and 33 deletions

View File

@@ -57,4 +57,21 @@ class AclMapper extends DeckMapper implements IPermissionMapper {
$sql = 'SELECT * from *PREFIX*deck_board_acl WHERE type = ? AND participant = ?';
return $this->findEntities($sql, [$type, $participant]);
}
/**
* @param $ownerId
* @param $newOwnerId
* @return void
*/
public function transferOwnership($ownerId, $newOwnerId)
{
$params = [
'owner' => $ownerId,
'newOwner' => $newOwnerId,
'type' => Acl::PERMISSION_TYPE_USER
];
$sql = "UPDATE `{$this->tableName}` SET `participant` = :newOwner WHERE `participant` = :owner AND `type` = :type";
$stmt = $this->execute($sql, $params);
$stmt->closeCursor();
}
}

View File

@@ -146,4 +146,20 @@ class AssignmentMapper extends QBMapper implements IPermissionMapper {
}
return null;
}
/**
* @param $ownerId
* @param $newOwnerId
* @return void
*/
public function transferOwnership($ownerId, $newOwnerId)
{
$params = [
'owner' => $ownerId,
'newOwner' => $newOwnerId
];
$sql = "UPDATE `{$this->tableName}` SET `participant` = :newOwner WHERE `participant` = :owner";
$stmt = $this->execute($sql, $params);
$stmt->closeCursor();
}
}

View File

@@ -475,4 +475,20 @@ class BoardMapper extends QBMapper implements IPermissionMapper {
return null;
});
}
/**
* @param $ownerId
* @param $newOwnerId
* @return void
*/
public function transferOwnership($ownerId, $newOwnerId)
{
$params = [
'owner' => $ownerId,
'newOwner' => $newOwnerId
];
$sql = "UPDATE `{$this->tableName}` SET `owner` = :newOwner WHERE `owner` = :owner";
$stmt = $this->execute($sql, $params);
$stmt->closeCursor();
}
}

View File

@@ -586,4 +586,20 @@ class CardMapper extends QBMapper implements IPermissionMapper {
return null;
});
}
/**
* @param $ownerId
* @param $newOwnerId
* @return void
*/
public function transferOwnership($ownerId, $newOwnerId)
{
$params = [
'owner' => $ownerId,
'newOwner' => $newOwnerId
];
$sql = "UPDATE `{$this->tableName}` SET `owner` = :newOwner WHERE `owner` = :owner";
$stmt = $this->execute($sql, $params);
$stmt->closeCursor();
}
}