|
|
|
@ -56,10 +56,6 @@ class RecentContactMapper extends QBMapper {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param string $uid
|
|
|
|
|
* @param int $id
|
|
|
|
|
*
|
|
|
|
|
* @return RecentContact
|
|
|
|
|
* @throws DoesNotExistException
|
|
|
|
|
*/
|
|
|
|
|
public function find(string $uid, int $id): RecentContact {
|
|
|
|
@ -75,11 +71,6 @@ class RecentContactMapper extends QBMapper {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param IUser $user
|
|
|
|
|
* @param string|null $uid
|
|
|
|
|
* @param string|null $email
|
|
|
|
|
* @param string|null $cloudId
|
|
|
|
|
*
|
|
|
|
|
* @return RecentContact[]
|
|
|
|
|
*/
|
|
|
|
|
public function findMatch(IUser $user,
|
|
|
|
@ -108,11 +99,7 @@ class RecentContactMapper extends QBMapper {
|
|
|
|
|
return $this->findEntities($select);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param string $uid
|
|
|
|
|
* @return int|null
|
|
|
|
|
*/
|
|
|
|
|
public function findLastUpdatedForUserId(string $uid):?int {
|
|
|
|
|
public function findLastUpdatedForUserId(string $uid): ?int {
|
|
|
|
|
$qb = $this->db->getQueryBuilder();
|
|
|
|
|
|
|
|
|
|
$select = $qb
|
|
|
|
@ -122,7 +109,7 @@ class RecentContactMapper extends QBMapper {
|
|
|
|
|
->orderBy('last_contact', 'DESC')
|
|
|
|
|
->setMaxResults(1);
|
|
|
|
|
|
|
|
|
|
$cursor = $select->execute();
|
|
|
|
|
$cursor = $select->executeQuery();
|
|
|
|
|
$row = $cursor->fetch();
|
|
|
|
|
|
|
|
|
|
if ($row === false) {
|
|
|
|
@ -139,6 +126,6 @@ class RecentContactMapper extends QBMapper {
|
|
|
|
|
->delete($this->getTableName())
|
|
|
|
|
->where($qb->expr()->lt('last_contact', $qb->createNamedParameter($olderThan)));
|
|
|
|
|
|
|
|
|
|
$delete->execute();
|
|
|
|
|
$delete->executeStatement();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|