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

Method readOwn

lib/Db/ReportMapper.php:141–162  ·  view source on GitHub ↗

* get single report for user * @param int $id * @return array * @throws Exception */

(int $id)

Source from the content-addressed store, hash-verified

139 * @throws Exception
140 */
141 public function readOwn(int $id)
142 {
143 $sql = $this->db->getQueryBuilder();
144 $sql->from(self::TABLE_NAME)
145 ->select('*')
146 ->where($sql->expr()->eq('id', $sql->createNamedParameter($id)))
147 ->andWhere($sql->expr()->eq('user_id', $sql->createNamedParameter($this->userId)))
148 ->orderBy('parent', 'ASC')
149 ->addOrderBy('name', 'ASC');
150 $statement = $sql->executeQuery();
151 $result = $statement->fetch();
152 $statement->closeCursor();
153
154 if ($result !== false) {
155 $result['dataset'] = (int) $result['dataset'];
156 $result['type'] = (int) $result['type'];
157 $result['parent'] = (int) $result['parent'];
158 $result['refresh'] = (int) $result['refresh'];
159 }
160
161 return $result;
162 }
163
164 /**
165 * get single report

Callers 6

addDataMethod · 0.45
addDataV2Method · 0.45
deleteDataV2Method · 0.45
addDataV4Method · 0.45
readMethod · 0.45
createEventMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected