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

Method getReportByToken

lib/Db/ShareMapper.php:49–65  ·  view source on GitHub ↗

* get all shared reports by token * uses for public pages * @param $token * @return array * @throws Exception */

($token)

Source from the content-addressed store, hash-verified

47 * @throws Exception
48 */
49 public function getReportByToken($token)
50 {
51 $sql = $this->db->getQueryBuilder();
52 $sql->from(self::TABLE_NAME_REPORT, 'DS')
53 ->leftJoin('DS', self::TABLE_NAME, 'SHARE', $sql->expr()->eq('DS.id', 'SHARE.item_source'))
54 ->select('DS.*')
55 ->addSelect('SHARE.permissions')
56 ->selectAlias('SHARE.domain', 'domain')
57 ->selectAlias('SHARE.password', 'password')
58 ->where($sql->expr()->eq('SHARE.token', $sql->createNamedParameter($token)))
59 ->andWhere($sql->expr()->eq('SHARE.item_type', $sql->createNamedParameter('report')))
60 ->andWhere($sql->expr()->eq('SHARE.uid_initiator', 'DS.user_id'));
61 $statement = $sql->executeQuery();
62 $result = $statement->fetch();
63 $statement->closeCursor();
64 return $result;
65 }
66
67 /**
68 * get all shared reports

Callers 4

authenticatePasswordMethod · 0.45
indexPublicMethod · 0.45
indexPublicMinMethod · 0.45
readPublicMethod · 0.45

Calls 2

eqMethod · 0.80
fetchMethod · 0.80

Tested by

no test coverage detected