tw: minor refactor

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/888/head
Varun Patil 2023-10-22 12:29:52 -07:00
parent a0d78504b9
commit f8f9ce7b4a
1 changed files with 4 additions and 3 deletions

View File

@ -193,11 +193,12 @@ class TimelineWrite
{ {
// Get full record // Get full record
$query = $this->connection->getQueryBuilder(); $query = $this->connection->getQueryBuilder();
$query->select('*') $record = $query->select('*')
->from('memories') ->from('memories')
->where($query->expr()->eq('fileid', $query->createNamedParameter($file->getId(), IQueryBuilder::PARAM_INT))) ->where($query->expr()->eq('fileid', $query->createNamedParameter($file->getId(), IQueryBuilder::PARAM_INT)))
->executeQuery()
->fetch()
; ;
$record = $query->executeQuery()->fetch();
// Begin transaction // Begin transaction
$this->connection->beginTransaction(); $this->connection->beginTransaction();
@ -207,8 +208,8 @@ class TimelineWrite
$query = $this->connection->getQueryBuilder(); $query = $this->connection->getQueryBuilder();
$query->delete($table) $query->delete($table)
->where($query->expr()->eq('fileid', $query->createNamedParameter($file->getId(), IQueryBuilder::PARAM_INT))) ->where($query->expr()->eq('fileid', $query->createNamedParameter($file->getId(), IQueryBuilder::PARAM_INT)))
->executeStatement()
; ;
$query->executeStatement();
} }
// Delete from map cluster // Delete from map cluster