Show
Ignore:
Timestamp:
05/29/08 17:22:32 (18 months ago)
Author:
bchoate
Message:

Adding support for a max_group_by method. BugId:79914

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-39/lib/MT/Object.pm

    r2453 r2459  
    707707sub sum_group_by   { shift->_proxy('sum_group_by',   @_) } 
    708708sub avg_group_by   { shift->_proxy('avg_group_by',   @_) } 
     709sub max_group_by   { shift->_proxy('max_group_by',   @_) } 
    709710sub remove_all     { shift->_proxy('remove_all',     @_) } 
    710711 
     
    20412042        avg => 'property_to_average' }) 
    20422043 
     2044=head2 Max by Group 
     2045 
     2046=over 4 
     2047 
     2048=item * Class->max_group_by() 
     2049 
     2050=back 
     2051 
     2052Like the count_group_by method, you can select objects from a MT::Object 
     2053store using a SQL 'MAX' operator. 
     2054 
     2055    my $iter = MT::Foo->max_group_by($terms, {%args, group => $group_exprs, 
     2056        max => 'column_name' }) 
     2057 
    20432058=head2 Sum by Group 
    20442059