memories/lib/Db/TimelineQueryLivePhoto.php

23 lines
587 B
PHP
Raw Permalink Normal View History

2022-11-22 11:31:31 +00:00
<?php
declare(strict_types=1);
namespace OCA\Memories\Db;
trait TimelineQueryLivePhoto
{
public function getLivePhotos(int $fileid): array
2022-11-22 11:31:31 +00:00
{
$qb = $this->connection->getQueryBuilder();
$qb->select('lp.fileid', 'lp.liveid')
->from('memories', 'm')
->where($qb->expr()->eq('m.fileid', $qb->createNamedParameter($fileid)))
->innerJoin('m', 'memories_livephoto', 'lp', $qb->expr()->andX(
$qb->expr()->eq('lp.liveid', 'm.liveid'),
))
;
return $qb->executeQuery()->fetchAll();
2022-11-22 11:31:31 +00:00
}
}