Aggregate(3pm)

๐Ÿ“ฆ version 2.1.1, in arch rolling

okay bestie, welcome to Aggregate(3pm) from LogReport's Lire Documentation โ€” we're about to make this base-class situation make sense, no cap ๐Ÿ’–

๐ŸŒธ NAME

Lire::Aggregate โ€” the base class for all operators that compute values from a group of DLF records. It's giving foundational icon energy, periodt. ๐Ÿ‘‘

๐Ÿ“œ SYNOPSIS

use Lire::Aggregate;

use base qw/ Lire::Aggregate /;

๐Ÿ’ซ DESCRIPTION

The Lire::Aggregate is the base class of all operators that computes values from a group of DLF records. These are the operators that are used inside aggregators. Basically: it's the parent-class moment for the operators doing the value-computing inside aggregators. ๐Ÿ’…

This package also defines most of the classes that represents the group operators available in Lire report specification. So yeah, it's also where a whole bunch of the group-operator class lore lives, bestie. โœจ


๐Ÿ› ๏ธ METHODS FOR SUBCLASSES OF Aggregate

๐Ÿงธ init( %params )

Two supplemental parameters are needed for Aggregates, and they are:

  • parent โ€” the Lire::Aggregator which contain this Aggregate.
  • name โ€” the identifier that can be used to find this operator in the report specification. It will be returned by the name() method.

This method implements the print() method required by Lire::ReportOperator. It prints an empty XML element named after op(). It also takes care of writing the name and label attributes. Other attributes can be added to the XML element by overriding the xml_attrs() method. XML girlies, this one's for you. ๐ŸŽ€

๐Ÿงฌ xml_attrs()

This method can be used to write additional XML attributes. The returned string will be output in the XML element.

โœ๏ธ set_name( $name )

Changes this operator's name. Simple as that, bestie. โœจ

๐Ÿ“Š create_numerical_info( $group_info )

Subclass must implement this method โ€” no dodging it. ๐Ÿซต

The $group_info parameter is a Lire::Report::GroupInfo object to which the operator implementation should add the appropriate ColumnInfo object to represent the data generated by the aggregate.

๐Ÿ”Ž build_query( $query )

FIXME. ๐Ÿ‘€

Provides a default implementation of build_query.

๐Ÿงฎ set_missing_cases_aggr_expr( $query )

Adds the aggregate expression to compute the number of missing cases based on the required fields returned by the sql_required_fields() method.

The method set_missing_cases_value() can be used to set the value from the returned DLF row.

๐Ÿงฉ set_missing_cases_value( $row, $value )

Sets the missing-cases value in $value to the value computed by the expression set using set_missing_cases_aggr_expr().

๐Ÿ—„๏ธ sql_aggr_expr()

Method used by the default implementation of build_query(). It should return the SQL aggregate expression that should be associated to this Aggregate's name. For example, a simple Count implementation could have returned 'count(*)' here. Iconic SQL behavior, honestly. ๐Ÿ”ฅ

๐Ÿงพ sql_required_fields()

Method used by set_missing_cases_aggr_expr() to set an aggregate expression that will return the number of missing cases for this aggregate. It should return a list of fields that will create a missing case when a value is NULL.

๐Ÿงฑ create_value( $parent_group, $row )

Method that is used by Aggregator when building the report table. The report should return a hash reference with the appropriate keys set. Consult Lire::Report::Entry(3pm) for details.

The $parent_group parameter is the Lire::Report::Group to which the value is added. This will be the table or containing group for values added to Entries, and it will be the Group's parent when creating a summary value.

The $row parameter is a hash ref containing the DlfResult row for which the value should be created.

Implementation should use the set_missing_cases_value() method to set the value's 'missing_cases' attribute.


๐Ÿ‘€ SEE ALSO

Go check these out, bestie:

โœ๏ธ AUTHORS

These legends wrote it:

  • Francis J. Lacoste <flacoste@logreport.org>
  • Wolfgang Sourdeau <wolfgang@logreport.org>

๐Ÿท๏ธ VERSION

$Id: Aggregate.pm,v 1.16 2006/07/23 13:16:27 vanbaal Exp $

Copyright (C) 2001-2003 Stichting LogReport Foundation
LogReport@LogReport.org

This file is part of Lire. ๐Ÿ’œ

Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html.


okay bestie, that's the whole Aggregate(3pm) page. Signing off from Lire 2.1.1, dated 2025-09-28 โ€” mwah, go slay those aggregators! ๐Ÿ’‹โœจ

๐Ÿ“ฆ where this page comes from