MCPcopy Create free account
hub / github.com/Rello/analytics / deleteShare

Method deleteShare

lib/Db/ShareMapper.php:257–269  ·  view source on GitHub ↗

* Delete an own share (sharee or receiver) * @param $shareId * @return bool * @throws Exception */

($shareId)

Source from the content-addressed store, hash-verified

255 * @throws Exception
256 */
257 public function deleteShare($shareId)
258 {
259 $sql = $this->db->getQueryBuilder();
260 $sql->select('id', 'item_type', 'item_source', 'type', 'uid_owner', 'uid_initiator')
261 ->from(self::TABLE_NAME)
262 ->where($sql->expr()->eq('id', $sql->createNamedParameter($shareId)))
263 ->andWhere($sql->expr()->orX(
264 $sql->expr()->eq('uid_initiator', $sql->createNamedParameter($this->userSession->getUser()->getUID())),
265 $sql->expr()->eq('uid_owner', $sql->createNamedParameter($this->userSession->getUser()->getUID()))
266 ));
267 $this->deleteAuditedShares($sql);
268 return true;
269 }
270
271 /**
272 * Delete all shares of a report

Callers 1

share-audit.phpFile · 0.45

Calls 4

deleteAuditedSharesMethod · 0.95
eqMethod · 0.80
getUserMethod · 0.80
getUIDMethod · 0.45

Tested by

no test coverage detected