* get all shared panoramas * @return array * @throws Exception */
()
| 90 | * @throws Exception |
| 91 | */ |
| 92 | public function getAllSharedPanoramas() |
| 93 | { |
| 94 | $sql = $this->db->getQueryBuilder(); |
| 95 | $sql->from(self::TABLE_NAME_PANORAMA, 'PANORAMA') |
| 96 | ->rightJoin('PANORAMA', self::TABLE_NAME, 'SHARE', $sql->expr()->eq('PANORAMA.id', 'SHARE.item_source')) |
| 97 | ->select('PANORAMA.*') |
| 98 | ->selectAlias('SHARE.id', 'shareId') |
| 99 | ->selectAlias('SHARE.type', 'shareType') |
| 100 | ->selectAlias('SHARE.uid_owner', 'shareUid_owner') |
| 101 | ->addSelect('SHARE.permissions') |
| 102 | ->where($sql->expr()->eq('SHARE.item_type', $sql->createNamedParameter('panorama'))) |
| 103 | ->andWhere($sql->expr()->eq('SHARE.uid_initiator', 'PANORAMA.user_id')); |
| 104 | $statement = $sql->executeQuery(); |
| 105 | $result = $statement->fetchAll(); |
| 106 | $statement->closeCursor(); |
| 107 | return $result; |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * Create a new share |