createQuery(); return $query->matching( $query->logicalAnd( [ $query->equals('user', $userUid), $query->equals('tablename', $tablename), $query->equals('objectUid', $objectUid) ] ) )->execute()->count(); } public function removeByUserTablenameObjectUid($userUid, $tablename, $objectUid) { $query = $this->createQuery(); $objs = $query->matching( $query->logicalAnd( [ $query->equals('user', $userUid), $query->equals('tablename', $tablename), $query->equals('objectUid', $objectUid) ] ) )->execute()->toArray(); foreach ($objs as $obj) { $this->remove($obj); } } public function getTop($limit) { /** @var QueryBuilder $queryBuilder */ $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_bookmarkslikesratings_domain_model_like'); return $queryBuilder ->select('tablename') ->addSelect('object_uid') ->addSelectLiteral('count(*) as number') ->from('tx_bookmarkslikesratings_domain_model_like') ->groupBy('tablename') ->addGroupBy('object_uid') ->orderBy('number', 'DESC') ->setMaxResults($limit) ->execute()->fetchAll(); } }