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

InstanceQuery   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 1
c 3
b 0
f 1
lcom 0
cbo 1
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A hasInstance() 0 4 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