Passed
Push — feature/786_podcasts ( f026ee )
by Pauli
11:46
created

PodcastChannelMapper::findUniqueEntity()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php declare(strict_types=1);
2
3
/**
4
 * ownCloud - Music app
5
 *
6
 * This file is licensed under the Affero General Public License version 3 or
7
 * later. See the COPYING file.
8
 *
9
 * @author Pauli Järvinen <[email protected]>
10
 * @copyright Pauli Järvinen 2021
11
 */
12
13
namespace OCA\Music\Db;
14
15
use \OCP\AppFramework\Db\Entity;
16
use \OCP\IDBConnection;
17
18
class PodcastChannelMapper extends BaseMapper {
19
	public function __construct(IDBConnection $db) {
20
		parent::__construct($db, 'music_podcast_channels', '\OCA\Music\Db\PodcastChannel', 'title');
21
	}
22
23
	/**
24
	 * @see \OCA\Music\Db\BaseMapper::findUniqueEntity()
25
	 * @param PodcastChannel $channel
26
	 * @return PodcastChannel
27
	 */
28
	protected function findUniqueEntity(Entity $episode) : Entity {
29
		$sql = $this->selectUserEntities("`rss_hash` = ?");
30
		return $this->findEntity($sql, [$entity->getUserId(), $entity->getRssHash()]);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $entity seems to be never defined.
Loading history...
31
	}
32
}
33