diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-10-04 13:28:23 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-10-04 13:28:23 +0400 |
commit | f05a25d60acb670d4292c67a10d0b408643ed3df (patch) | |
tree | 19438be0d2c12a71e80c8fe752e77be1f792802d /plugins/SitesManager/Model.php | |
parent | 1a7dbc5ff6ab987338fa644f1c4c7a07602c10f6 (diff) |
moved some queries within core to model files
This is only a start. Especially the Tracker model contains quite a bunch of different models. Ideally, one day, the tracker is refactored and all the goal tracker stuff including the queries are in the goal plugins, all the ecommerce stuff is in an ecommerce plugin etc. Haven't moved some of the LogAggregator queries.
Diffstat (limited to 'plugins/SitesManager/Model.php')
-rw-r--r-- | plugins/SitesManager/Model.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/SitesManager/Model.php b/plugins/SitesManager/Model.php index 7aa779b530..971844c40b 100644 --- a/plugins/SitesManager/Model.php +++ b/plugins/SitesManager/Model.php @@ -24,6 +24,16 @@ class Model $this->table = Common::prefixTable(self::$rawPrefix); } + public function createSite($site) + { + $db = $this->getDb(); + $db->insert($this->table, $site); + + $idSite = $db->lastInsertId(); + + return $idSite; + } + /** * Returns all websites belonging to the specified group * @param string $group Group name @@ -202,8 +212,8 @@ class Model */ public function getSiteFromId($idSite) { - $site = Db::get()->fetchRow("SELECT * FROM " . $this->table . " - WHERE idsite = ?", $idSite); + $site = $this->getDb()->fetchRow("SELECT * FROM " . $this->table . " + WHERE idsite = ?", $idSite); return $site; } |