Your IP : 216.73.217.64


Current Path : /home3/gp97/tbfmobile.97gp.net/app/sae/modules/Topic/Model/
Upload File :
Current File : //home3/gp97/tbfmobile.97gp.net/app/sae/modules/Topic/Model/Subscription.php

<?php

class Topic_Model_Subscription extends Core_Model_Default {

    public function __construct($params = array()) {
        parent::__construct($params);
        $this->_db_table = 'Topic_Model_Db_Table_Subscription';
        return $this;
    }

    public function isSubscribed($category_id, $device_uid) {
        $is = $this->getTable()->isSubscribed($category_id,$device_uid);
        return count($is)==0?false:true;
    }

    public function findAllowedCategories($device_uid) {
        $categories = $this->getTable()->findAllowedCategories($device_uid);
        $data = array();
        foreach($categories as $category) {
            $data[] = $category->getCategoryId();
        }

        return $data;
    }

}