Changeset 2664 for branches/release-41/lib/MT/ObjectDriver/Driver/DBI.pm
- Timestamp:
- 07/01/08 01:50:42 (17 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/release-41/lib/MT/ObjectDriver/Driver/DBI.pm
r2629 r2664 222 222 my @returnvals = map { $$_ } @bindvars; 223 223 $i++; 224 $class->call_trigger('post_group_by', \$count, \@returnvals) 225 unless $args->{no_triggers}; 224 226 return($count, @returnvals); 225 227 }; … … 261 263 $stmt->add_select($select => $select); 262 264 my $sql = $stmt->as_sql; 263 $driver->select_one($sql, $stmt->bind); 265 my $value = $driver->select_one($sql, $stmt->bind); 266 $class->call_trigger('post_select_aggregate', \$value) 267 unless $orig_args->{no_triggers}; 268 return $value; 264 269 } 265 270 … … 559 564 TODO 560 565 566 =head1 Callbacks 567 568 MT::ObjectDriver::Driver::DBI fires the following callbacks, 569 or "triggers" when it loads data from the database. 570 571 =over 4 572 573 =item * post_select_aggregate 574 575 callback($class, \$value) 576 577 Callback issued prior to returning the value that is retrieved 578 as the result of select_one method. 579 580 =item * post_group_by 581 582 callback($class, \$value, \@retrunvals) 583 584 Callback issued prior to returning the number and additional return 585 values that are retrieved as the result of grouping query. The value 586 in the $value parameter is what was calculated from the database. 587 For example, in count_group_by method, $value holds the count for each 588 group, while in sum_group_by method, $value holds the sum for each group. 589 @returnvals parameter holds the additional data that wiil be retured. 590 561 591 =head1 AUTHOR & COPYRIGHT 562 592
