Episode::getIdField()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * Represents a TV show episode
5
 *
6
 * @author Sam Stenvall <[email protected]>
7
 * @copyright Copyright &copy; Sam Stenvall 2013-
8
 * @license https://www.gnu.org/licenses/gpl.html The GNU General Public License v3.0
9
 */
10
class Episode extends File implements IStreamable
11
{
12
	
13
	/**
14
	 * @var int
15
	 */
16
	public $episodeid;
17
	
18
	/**
19
	 * @var int
20
	 */
21
	public $tvshowid;
22
	
23
	/**
24
	 * @var int
25
	 */
26
	public $episode;
27
	
28
	/**
29
	 * @var string
30
	 */
31
	public $showtitle;
32
	
33
	/**
34
	 * @var int
35
	 */
36
	public $season;
37
	
38
	/**
39
	 * @var string the episode title (not the same as the label)
40
	 */
41
	public $title;
42
	
43
	public function getIdField()
44
	{
45
		return 'episodeid';
46
	}
47
	
48
	/**
49
	 * Returns a string based on season and episode number, e.g. 1x05.
50
	 * @return string
51
	 */
52
	public function getEpisodeString()
53
	{
54
		return $this->season.'x'.str_pad($this->episode, 2, '0', STR_PAD_LEFT);
55
	}
56
	
57
}
58