12.15. The OpenCReport\ReportBreak class #

12.15.1. Get next break
12.15.2. Add a breakfield to a break
12.15.3. Check breakfields
12.15.4. Reset variables associated with a break
12.15.5. Add a "trigger" callback to a break
12.15.6. Get the name of a break
12.15.7. Get output sections of a break

class OpenCReport\ReportBreak {
    public final get_next():
                     ?OpenCReport\ReportBreak;

    public final breakfield_add(
                     OpenCReport\Expr $breakfield_expr):
                     void;

    public final check_fields(): bool;

    public final reset_vars(): void;

    public final add_trigger_cb(
                     ?string $callback):
                     void;

    public final name(): string;

    public final header(): OpenCReport\Output;
    public final footer(): OpenCReport\Output;
}

12.15.1. Get next break #

Get the next break object from the chain of breaks in the report this break belongs to. This method may only be called on an object that was marked as an iterator, i.e. one that was created by OpenCReport\Report::break_get_first().

public final
OpenCReport\ReportBreak::get_next():
                     ?OpenCReport\ReportBreak;

12.15.2. Add a breakfield to a break #

Add a breakfield to a break. A break may consists of multiple breakfields. A break triggers if any of the breakfields change from one data line to another.

public final
OpenCReport\ReportBreak::breakfield_add(
                     OpenCReport\Expr $breakfield_expr):
                     void;

12.15.3. Check breakfields #

Check breakfields of a break. This method returns true if the break triggers, i.e. field values for the current data row do not match the values for the previous data row. It also the triggers for the first row when there is no previous row. It is used internally by the report executor and also used by unit tests. It may be useful to implement a custom report executor.

public final
OpenCReport\ReportBreak::check_fields(): bool;

12.15.4. Reset variables associated with a break #

Reset report variables associated with a break. Such variables were created with specifying the "reset on break" break name. These variables restart from their initial values. It is used internally by the report executor and also used by unit tests. It may be useful to implement a custom report executor.

public final
OpenCReport\ReportBreak::reset_vars(): void;

12.15.5. Add a "trigger" callback to a break #

Add a "trigger" callback to the break.

public final
OpenCReport\ReportBreak::add_trigger_cb(
                     ?string $callback):
                     void;

12.15.6. Get the name of a break #

Get the name of a break. It may be useful if the breaks were added via a report XML descriptor but variables are added afterwards from code.

public final
OpenCReport\ReportBreak::name(): string;

12.15.7. Get output sections of a break #

Get the header and footer sections of a break. See also BreakHeader and BreakFooter. For class methods of OpenCReport\Output, see Section 12.16

public final
OpenCReport\ReportBreak::header(): OpenCReport\Output;

public final
OpenCReport\ReportBreak::footer(): OpenCReport\Output;