Completed
Push — master ( 5b5cdc...a6b764 )
by Sam
02:28
created

InstanceQuery::hasInstance()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Jalle19\StatusManager\Database;
4
5
use Jalle19\StatusManager\Database\Base\InstanceQuery as BaseInstanceQuery;
6
use Jalle19\tvheadend\Tvheadend;
7
8
/**
9
 * @package   Jalle19\StatusManager\Database
10
 * @copyright Copyright &copy; Sam Stenvall 2015-
11
 * @license   https://www.gnu.org/licenses/gpl.html The GNU General Public License v2.0
12
 */
13
class InstanceQuery extends BaseInstanceQuery
14
{
15
16
	/**
17
	 * @param Tvheadend $instance
18
	 *
19
	 * @return bool whether the instance exists in the database
20
	 */
21
	public function hasInstance(Tvheadend $instance)
22
	{
23
		return $this->findPk($instance->getHostname()) !== null;
24
	}
25
26
}
27