summaryrefslogtreecommitdiff
path: root/app/models/EntriesGetter.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-09-02 22:06:51 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-09-02 22:06:51 +0200
commitf855dbdca6e95ac367b7a9dae9d3a866e1f85d37 (patch)
treeb56089793ec4b41414f3e7574295684bae5170ff /app/models/EntriesGetter.php
parent31a6a13268023a2db5eba2445ee6c7db4a6d9623 (diff)
SQL and model optimisation
Big effect (on speed and memory), but few changes :-) Drastically reduced the number of SQL requests needed (from 233 down to 8 to load the home page with my own data set = 140 feeds in 15 categories). Drastically reduced the amount of data transferred from MySQL to PHP.
Diffstat (limited to 'app/models/EntriesGetter.php')
-rw-r--r--app/models/EntriesGetter.php24
1 files changed, 17 insertions, 7 deletions
diff --git a/app/models/EntriesGetter.php b/app/models/EntriesGetter.php
index ca92804a7..dc7ecca7c 100644
--- a/app/models/EntriesGetter.php
+++ b/app/models/EntriesGetter.php
@@ -94,41 +94,51 @@ class EntriesGetter {
public function execute () {
$entryDAO = new EntryDAO ();
- HelperEntry::$nb = $this->nb;
- HelperEntry::$first = $this->first;
+ HelperEntry::$nb = $this->nb; //TODO: Update: Now done in SQL
+ HelperEntry::$first = $this->first; //TODO: Update: Now done in SQL
HelperEntry::$filter = $this->filter;
switch ($this->type['type']) {
case 'all':
list ($this->entries, $this->next) = $entryDAO->listEntries (
$this->state,
- $this->order
+ $this->order,
+ $this->first,
+ $this->nb
);
break;
case 'favoris':
list ($this->entries, $this->next) = $entryDAO->listFavorites (
$this->state,
- $this->order
+ $this->order,
+ $this->first,
+ $this->nb
);
break;
case 'public':
list ($this->entries, $this->next) = $entryDAO->listPublic (
$this->state,
- $this->order
+ $this->order,
+ $this->first,
+ $this->nb
);
break;
case 'c':
list ($this->entries, $this->next) = $entryDAO->listByCategory (
$this->type['id'],
$this->state,
- $this->order
+ $this->order,
+ $this->first,
+ $this->nb
);
break;
case 'f':
list ($this->entries, $this->next) = $entryDAO->listByFeed (
$this->type['id'],
$this->state,
- $this->order
+ $this->order,
+ $this->first,
+ $this->nb
);
break;
default: