summaryrefslogtreecommitdiff
path: root/app/Models/EntryDAO.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-07-07 18:25:48 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-07-07 18:25:48 +0200
commit439a0e2991231db51232646736a4bf78cfb2bffd (patch)
tree17cb1fad289521cbd75864390a6bd24694ee498d /app/Models/EntryDAO.php
parent3bbd0e446f6a1a0c41a4db36d2841db36dc34004 (diff)
SQL: improved performance for adding new articles
Diffstat (limited to 'app/Models/EntryDAO.php')
-rw-r--r--app/Models/EntryDAO.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index 1775af63c..6f3f472f6 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -6,14 +6,18 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
return parent::$sharedDbType !== 'sqlite';
}
- public function addEntry($valuesTmp) {
+ public function addEntryPrepare() {
$sql = 'INSERT INTO `' . $this->prefix . 'entry`(id, guid, title, author, '
. ($this->isCompressed() ? 'content_bin' : 'content')
. ', link, date, is_read, is_favorite, id_feed, tags) '
. 'VALUES(?, ?, ?, ?, '
. ($this->isCompressed() ? 'COMPRESS(?)' : '?')
. ', ?, ?, ?, ?, ?, ?)';
- $stm = $this->bd->prepare($sql);
+ return $this->bd->prepare($sql);
+ }
+
+ public function addEntry($valuesTmp, $preparedStatement = null) {
+ $stm = $preparedStatement === null ? addEntryPrepare() : $preparedStatement;
$values = array(
$valuesTmp['id'],