Skip to content

Table class: refactoring group and related methods #30

@roberto-butti

Description

@roberto-butti

Consider this suggestion: https://twitter.com/marekgibney/status/1519938757893439488

$table->group('product')->transform(Operation::aggregate(['total'=>['price', 'array_sum']]));

Table::group -> Groups rows by field
Table::transform -> Transforms rows by func
Operation::aggregate -> Aggregates fields by funcs

Checklist

  • implement method
  • write phpdoc for the function
  • write test in tests/TableTest.php
  • execute composer format
  • execute composer test-coverage
  • check if your method has full test coverage
  • add method in changelog
  • update doc/table.md adding a use case of the new method
  • update cheatsheet (examples/cheatsheet-table.php)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions