|
@@ 206-217 (lines=12) @@
|
| 203 |
|
* @return IShare |
| 204 |
|
* |
| 205 |
|
*/ |
| 206 |
|
public function move(IShare $share, $userId) { |
| 207 |
|
|
| 208 |
|
$childId = $this->getShareChildId($share, $userId, true); |
| 209 |
|
|
| 210 |
|
$qb = $this->getBaseUpdateSql(); |
| 211 |
|
$qb->set('file_target', $qb->createNamedParameter($share->getTarget())); |
| 212 |
|
$this->limitToShareChildren($qb, $userId, $share->getId()); |
| 213 |
|
$this->limitToShare($qb, $childId); |
| 214 |
|
$qb->execute(); |
| 215 |
|
|
| 216 |
|
return $share; |
| 217 |
|
} |
| 218 |
|
|
| 219 |
|
|
| 220 |
|
/** |
|
@@ 228-241 (lines=14) @@
|
| 225 |
|
* |
| 226 |
|
* @return bool |
| 227 |
|
*/ |
| 228 |
|
private function getShareChildId(IShare $share, $userId) { |
| 229 |
|
$qb = $this->getBaseSelectSql($share->getId()); |
| 230 |
|
$this->limitToShareChildren($qb, $userId, $share->getId()); |
| 231 |
|
|
| 232 |
|
$child = $qb->execute(); |
| 233 |
|
$data = $child->fetch(); |
| 234 |
|
$child->closeCursor(); |
| 235 |
|
|
| 236 |
|
if ($data === false) { |
| 237 |
|
return $this->createShareChild($userId, $share); |
| 238 |
|
} |
| 239 |
|
|
| 240 |
|
return $data['id']; |
| 241 |
|
} |
| 242 |
|
|
| 243 |
|
|
| 244 |
|
/** |