diff options
Diffstat (limited to 'lib/Db')
-rw-r--r-- | lib/Db/Item.php | 4 | ||||
-rw-r--r-- | lib/Db/ItemMapperV2.php | 12 |
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/Db/Item.php b/lib/Db/Item.php index d7efdd14b..37497049c 100644 --- a/lib/Db/Item.php +++ b/lib/Db/Item.php @@ -591,9 +591,11 @@ class Item extends Entity implements IAPI, \JsonSerializable * * @return boolean */ - public function isSupportedMime(string $mime): bool + public function isSupportedMime(?string $mime): bool { + return ( + $mime !== null || stripos($mime, 'audio/') !== false || stripos($mime, 'image/') !== false || stripos($mime, 'video/') !== false); diff --git a/lib/Db/ItemMapperV2.php b/lib/Db/ItemMapperV2.php index edb8ba55f..222340744 100644 --- a/lib/Db/ItemMapperV2.php +++ b/lib/Db/ItemMapperV2.php @@ -95,12 +95,18 @@ class ItemMapperV2 extends NewsMapperV2 return $this->findEntity($builder); } - public function findByGuidHash(string $getGuidHash): Item + public function findByGuidHash(string $guidHash): Item { - throw new DoesNotExistException('fasi'); + $builder = $this->db->getQueryBuilder(); + $builder->addSelect('*') + ->from($this->tableName) + ->andWhere('guid_hash = :guid_hash') + ->setParameter(':guid_hash', $guidHash, IQueryBuilder::PARAM_STR); + + return $this->findEntity($builder); } - public function findAllForFeed(int $feedId) + public function findAllForFeed(int $feedId): array { $builder = $this->db->getQueryBuilder(); $builder->addSelect('*') |