diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/entity.php | 14 | ||||
-rw-r--r-- | db/item.php | 4 |
2 files changed, 16 insertions, 2 deletions
diff --git a/db/entity.php b/db/entity.php index 165c7a476..a13bcce34 100644 --- a/db/entity.php +++ b/db/entity.php @@ -27,11 +27,14 @@ namespace OCA\News\Db; abstract class Entity { - public $id; + public $id; + + private $tableName; private $updatedFields; - public function __construct(){ + public function __construct($tableName){ $this->updatedFields = array(); + $this->tableName = '*dbprefix*' . $tableName; } @@ -146,4 +149,11 @@ abstract class Entity { } + /** + * @return string the table name + */ + public function getTableName(){ + return $this->tableName; + } + }
\ No newline at end of file diff --git a/db/item.php b/db/item.php index d7546bcd2..403f35b35 100644 --- a/db/item.php +++ b/db/item.php @@ -41,6 +41,10 @@ class Item extends Entity { public $status; public $feedTitle; + public function __construct(){ + parent::__construct('news_items'); + } + public function setRead() { $this->markFieldUpdated('status'); $this->status &= ~StatusFlag::UNREAD; |