Changeset 3115

Show
Ignore:
Timestamp:
04/13/08 09:35:35 (3 months ago)
Author:
pmjones
Message:

Solar_App_Bookmarks: [CHG] Instead of calling countPages() separately, now uses the 'count_pages' key in fetches.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Solar/App/Bookmarks.php

    r3038 r3115  
    377377        // must be the item owner to edit it 
    378378        $item = $this->_bookmarks->fetchOneById($id, array( 
    379             'eager' => array('taggings', 'tags'), 
     379            'eager' => array('tags'), 
    380380        )); 
    381381         
     
    546546            'paging' => $this->_query('paging', 10), 
    547547            'page'   => $this->_query('page', 1), 
    548             'eager'  => array('taggings', 'tags'), 
     548            'eager'  => array('tags'), 
     549            'count_pages' => true, 
    549550        ); 
    550551         
    551552        // get the list of bookmarks 
    552553        $this->list = $this->_bookmarks->fetchAllByTags($tag_list, $params); 
    553          
    554         // get the total pages and row-count 
    555         $total = $this->_bookmarks->countPagesByTags($tag_list, $params); 
    556554         
    557555        // flash forward the backlink in case we go to edit, but only if this 
     
    565563         
    566564        // assign the list of tags in use 
    567         $this->tags_in_use   = $this->_tags->fetchAllWithCount(array( 
     565        $this->tags_in_use = $this->_tags->fetchAllWithCount(array( 
    568566            'order' => 'tags.name' 
    569567        )); 
    570568         
    571569        // assign everything else for the view 
     570        $total = $this->list->getPagerInfo(); 
     571         
    572572        $this->count         = $total['count']; 
    573573        $this->pages         = $total['pages']; 
     
    614614            'paging' => $this->_query('paging', 10), 
    615615            'page'   => $this->_query('page', 1), 
    616             'eager'  => array('taggings', 'tags'), 
     616            'eager'  => array('tags'), 
     617            'count_pages' => true, 
    617618        ); 
    618619         
     
    620621        if ($tag_list) { 
    621622            $this->list = $this->_bookmarks->fetchAllByTags($tag_list, $params); 
    622             $total = $this->_bookmarks->countPagesByTags($tag_list, $params); 
    623623        } else { 
    624624            $this->list = $this->_bookmarks->fetchAll($params); 
    625             $total = $this->_bookmarks->countPages($params); 
    626625        } 
    627626         
     
    641640         
    642641        // assign remaining view vars 
     642        $total = $this->list->getPagerInfo(); 
    643643        $this->count         = $total['count']; 
    644644        $this->pages         = $total['pages'];