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

InputQuery::hasInput()   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\InputQuery as BaseInputQuery;
6
use Jalle19\tvheadend\model\SubscriptionStatus;
7
8
/**
9
 * Skeleton subclass for performing query and update operations on the 'input' table.
10
 *
11
 *
12
 *
13
 * You should add additional methods to this class to meet the
14
 * application requirements.  This class will only be generated as
15
 * long as it does not already exist in the output directory.
16
 *
17
 */
18
class InputQuery extends BaseInputQuery
19
{
20
21
	/**
22
	 * @param string $uuid
23
	 *
24
	 * @return bool
25
	 */
26
	public function hasInput($uuid)
27
	{
28
		return $this->findPk($uuid) !== null;
29
	}
30
31
32
	/**
33
	 * @param string             $instanceName
34
	 * @param SubscriptionStatus $status
35
	 *
36
	 * @return $this|\Propel\Runtime\ActiveQuery\Criteria
37
	 */
38
	public function filterBySubscriptionStatus($instanceName, SubscriptionStatus $status)
39
	{
40
		return $this->filterByInstanceName($instanceName)
41
		            ->filterByNetwork(Subscription::parseNetwork($status))
42
		            ->filterByMux(Subscription::parseMux($status))
43
		            ->addDescendingOrderByColumn('started');
44
	}
45
46
}
47