| 1 | <?php |
||
| 13 | class Instance implements \JsonSerializable |
||
| 14 | { |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string the name of the instance |
||
| 18 | */ |
||
| 19 | private $_name; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var array the names of users whose subscriptions should be ignored |
||
| 23 | */ |
||
| 24 | private $_ignoredUsers; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var Tvheadend the actual tvheadend instance |
||
| 28 | */ |
||
| 29 | private $_instance; |
||
| 30 | |||
| 31 | |||
| 32 | /** |
||
| 33 | * Instance constructor. |
||
| 34 | * |
||
| 35 | * @param string $name |
||
| 36 | * @param string $address |
||
| 37 | * @param int $port |
||
| 38 | */ |
||
| 39 | 1 | public function __construct($name, $address, $port) |
|
| 40 | { |
||
| 41 | 1 | $this->_name = $name; |
|
| 42 | |||
| 43 | // Create the actual instance |
||
| 44 | 1 | $this->_instance = new Tvheadend($address, $port); |
|
| 45 | 1 | } |
|
| 46 | |||
| 47 | |||
| 48 | /** |
||
| 49 | * @return string |
||
| 50 | */ |
||
| 51 | 2 | public function getName() |
|
| 55 | |||
| 56 | |||
| 57 | /** |
||
| 58 | * @return array |
||
| 59 | */ |
||
| 60 | public function getIgnoredUsers() |
||
| 64 | |||
| 65 | |||
| 66 | /** |
||
| 67 | * @param array $ignoredUsers |
||
| 68 | */ |
||
| 69 | public function setIgnoredUsers($ignoredUsers) |
||
| 73 | |||
| 74 | |||
| 75 | /** |
||
| 76 | * Sets the credentials to use |
||
| 77 | * |
||
| 78 | * @param $username |
||
| 79 | * @param $password |
||
| 80 | */ |
||
| 81 | public function setCredentials($username, $password) |
||
| 85 | |||
| 86 | |||
| 87 | /** |
||
| 88 | * @return Tvheadend |
||
| 89 | */ |
||
| 90 | public function getInstance() |
||
| 94 | |||
| 95 | |||
| 96 | /** |
||
| 97 | * @inheritdoc |
||
| 98 | */ |
||
| 99 | public function jsonSerialize() |
||
| 105 | |||
| 106 | } |
||
| 107 |