Changeset 299 for wiki-toolkit/trunk/lib/Wiki/Toolkit/Store/Database.pm
- Timestamp:
- 05/18/06 18:19:44 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
wiki-toolkit/trunk/lib/Wiki/Toolkit/Store/Database.pm
r298 r299 1464 1464 $sth->execute( $node_id ); 1465 1465 1466 # Need to hold onto the last row by hash ref, so we don't trash 1467 # it every time 1468 my %first_data; 1469 my $dataref = \%first_data; 1470 1466 1471 # Haul out the data 1467 1472 my @versions; 1468 1473 while(my @results = $sth->fetchrow_array) { 1469 # TODO: Support metadata multi-rows 1470 my %data; 1474 my %data = %$dataref; 1475 1476 # Is it the same version as last time? 1477 if(%data && $data{'version'} != $results[2]) { 1478 # New version 1479 push @versions, $dataref; 1480 %data = (); 1481 } else { 1482 # Same version as last time, must be more metadata 1483 } 1484 1485 # Grab the core data (will be the same on multi-row for metadata) 1471 1486 @data{ qw( node_id name version last_modified ) } = @results; 1472 1487 … … 1477 1492 } 1478 1493 if($with_metadata) { 1479 warn("Not supported properly yet"); 1494 my ($m_type,$m_value) = @results[$i,($i+1)]; 1495 $data{'metadata'}->{$m_type} = $m_value; 1480 1496 } 1481 1497 1482 push @versions, \%data; 1498 # Save where we've got to 1499 $dataref = \%data; 1500 } 1501 1502 # Handle final row saving 1503 if($dataref) { 1504 push @versions, $dataref; 1483 1505 } 1484 1506
