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

Method getRecordCount

lib/Db/StorageMapper.php:308–320  ·  view source on GitHub ↗

* Simulate delete data * @param int $datasetId * @param string|null $user_id * @return array * @throws Exception */

(int $datasetId, ?string $user_id = null)

Source from the content-addressed store, hash-verified

306 * @throws Exception
307 */
308 public function getRecordCount(int $datasetId, ?string $user_id = null)
309 {
310 if ($user_id) $this->userId = $user_id;
311 $sql = $this->db->getQueryBuilder();
312 $sql->from(self::TABLE_NAME)
313 ->selectAlias($sql->func()->count('*'), 'count')
314 ->where($sql->expr()->eq('user_id', $sql->createNamedParameter($this->userId)))
315 ->andWhere($sql->expr()->eq('dataset', $sql->createNamedParameter($datasetId)));
316 $statement = $sql->executeQuery();
317 $result = $statement->fetch();
318 $statement->closeCursor();
319 return $result;
320 }
321
322 private function applyFilterOptions(IQueryBuilder $sql, $options): void
323 {

Callers

nothing calls this directly

Calls 3

countMethod · 0.80
eqMethod · 0.80
fetchMethod · 0.80

Tested by

no test coverage detected