diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-20 12:03:02 +0100 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-20 12:03:02 +0100 |
commit | 5a32f7a95687f7599c4c36f23a9807cf52a312d6 (patch) | |
tree | 11829359624e471f090bb8ad75b20978c3883532 /db | |
parent | d18ab3212a4e6f0101722e842c515895408d9c18 (diff) |
added tablename for entites
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; |