| 1 | <?php |
||
| 14 | class MetaSubscriptions |
||
| 15 | { |
||
| 16 | protected $subscriptions; |
||
| 17 | |||
| 18 | public function __construct() |
||
| 19 | { |
||
| 20 | $this->subscriptions = $this->getSubscriptions( |
||
| 21 | \CampTemplate::singleton()->context()->publication->identifier, |
||
| 22 | \CampTemplate::singleton()->context()->user->identifier |
||
| 23 | ); |
||
| 24 | |||
| 25 | if (count($this->subscriptions) == 0) { |
||
| 26 | $this->subscriptions = array(); |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Get all subscriptions by given publication id and user id. |
||
| 32 | * |
||
| 33 | * @param int $publicationId Publication id |
||
| 34 | * @param int $userId User id |
||
| 35 | * |
||
| 36 | * @return array Returns array of subscriptions' ids |
||
| 37 | */ |
||
| 38 | protected function getSubscriptions($publicationId, $userId) |
||
| 57 | } |
||
| 58 |