Avoid unnecessary assignement.

This commit is contained in:
Loic d'Anterroches 2009-10-06 21:33:58 +02:00
parent 06668db697
commit ec8ff4f76b
2 changed files with 3 additions and 6 deletions

View File

@ -240,8 +240,7 @@ class IDF_Views_Wiki
$dep = Pluf_Model_InArray($dtag, $tags); $dep = Pluf_Model_InArray($dtag, $tags);
$title = $page->title; $title = $page->title;
$revision = $page->get_current_revision(); $revision = $page->get_current_revision();
$db = $page->getDbConnection(); $false = Pluf_DB_BooleanToDb(false, $page->getDbConnection());
$false = Pluf_DB_BooleanToDb(false, $db);
$revs = $page->get_revisions_list(array('order' => 'creation_dtime DESC', $revs = $page->get_revisions_list(array('order' => 'creation_dtime DESC',
'filter' => 'is_head='.$false)); 'filter' => 'is_head='.$false));
return Pluf_Shortcuts_RenderToResponse('idf/wiki/view.html', return Pluf_Shortcuts_RenderToResponse('idf/wiki/view.html',
@ -281,8 +280,7 @@ class IDF_Views_Wiki
$title = sprintf(__('Delete Old Revision of %s'), $page->title); $title = sprintf(__('Delete Old Revision of %s'), $page->title);
$revision = $page->get_current_revision(); $revision = $page->get_current_revision();
$db = $page->getDbConnection(); $false = Pluf_DB_BooleanToDb(false, $page->getDbConnection());
$false = Pluf_DB_BooleanToDb(false, $db);
$revs = $page->get_revisions_list(array('order' => 'creation_dtime DESC', $revs = $page->get_revisions_list(array('order' => 'creation_dtime DESC',
'filter' => 'is_head='.$false)); 'filter' => 'is_head='.$false));
return Pluf_Shortcuts_RenderToResponse('idf/wiki/delete.html', return Pluf_Shortcuts_RenderToResponse('idf/wiki/delete.html',

View File

@ -146,8 +146,7 @@ class IDF_WikiPage extends Pluf_Model
function get_current_revision() function get_current_revision()
{ {
$db = $this->getDbConnection(); $true = Pluf_DB_BooleanToDb(true, $this->getDbConnection());
$true = Pluf_DB_BooleanToDb(true, $db);
$rev = $this->get_revisions_list(array('filter' => 'is_head='.$true, $rev = $this->get_revisions_list(array('filter' => 'is_head='.$true,
'nb' => 1)); 'nb' => 1));
return ($rev->count() == 1) ? $rev[0] : null; return ($rev->count() == 1) ? $rev[0] : null;