* delete all shares when a share-receiving-user is deleted * * @param $userId * @return bool * @throws Exception */
($userId)
| 295 | * @throws Exception |
| 296 | */ |
| 297 | public function deleteByUser($userId) |
| 298 | { |
| 299 | $sql = $this->db->getQueryBuilder(); |
| 300 | $sql->select('id', 'item_type', 'item_source', 'type', 'uid_owner', 'uid_initiator') |
| 301 | ->from(self::TABLE_NAME) |
| 302 | ->where($sql->expr()->eq('uid_owner', $sql->createNamedParameter($userId))) |
| 303 | ->andWhere($sql->expr()->eq('type', $sql->createNamedParameter(0))); |
| 304 | $this->deleteAuditedShares($sql); |
| 305 | return true; |
| 306 | } |
| 307 | |
| 308 | /** Update only shares owned by the actor; audit only persisted changes. */ |
| 309 | private function updateShareField($shareId, string $field, $value, string $action): bool |
no test coverage detected