class legend implements groupposition_interface

Legend group position class

group_legend is an ascending list 1, 2, ..., n for groups which are displayed. 1 is the first group, n the last. If the value is 0 (self::GROUP_DISABLED) the group is not displayed.

Constants

GROUP_DISABLED

Group is not displayed

Properties

protected driver_interface $db

Database object

Methods

__construct(driver_interface $db)

Constructor

int
get_group_value(int $group_id)

Returns the group_legend for a given group, if the group exists.

int
get_group_count()

Get number of groups, displayed on the legend

bool
add_group(int $group_id)

Addes a group by group_id

bool
delete_group(int $group_id, bool $skip_group = false)

Deletes a group by setting the field to self::GROUP_DISABLED and closing the gap in the list.

bool
move_up(int $group_id)

Moves a group up by group_id

bool
move_down(int $group_id)

Moves a group down by group_id

bool
move(int $group_id, int $delta)

Moves a group up/down

static string
group_type_language(int $group_type)

Get group type language var

Details

at line 41
__construct(driver_interface $db)

Constructor

Parameters

driver_interface $db

Database object

at line 53
int get_group_value(int $group_id)

Returns the group_legend for a given group, if the group exists.

Parameters

int $group_id

group_id of the group to be selected

Return Value

int

position of the group

Exceptions

exception

at line 76
int get_group_count()

Get number of groups, displayed on the legend

Return Value

int

value of the last item displayed

at line 91
bool add_group(int $group_id)

Addes a group by group_id

Parameters

int $group_id

group_id of the group to be added

Return Value

bool

True if the group was added successfully

at line 118
bool delete_group(int $group_id, bool $skip_group = false)

Deletes a group by setting the field to self::GROUP_DISABLED and closing the gap in the list.

Parameters

int $group_id

group_id of the group to be deleted

bool $skip_group

Skip setting the value for this group, to save the query, when you need to update it anyway.

Return Value

bool

True if the group was deleted successfully

at line 150
bool move_up(int $group_id)

Moves a group up by group_id

Parameters

int $group_id

group_id of the group to be moved

Return Value

bool

True if the group was moved successfully

at line 158
bool move_down(int $group_id)

Moves a group down by group_id

Parameters

int $group_id

group_id of the group to be moved

Return Value

bool

True if the group was moved successfully

at line 166
bool move(int $group_id, int $delta)

Moves a group up/down

Parameters

int $group_id

group_id of the group to be moved

int $delta

number of steps:

  • positive = move up
  • negative = move down

Return Value

bool

True if the group was moved successfully

at line 220
static string group_type_language(int $group_type)

Get group type language var

Parameters

int $group_type

group_type from the groups-table

Return Value

string

name of the language variable for the given group-type.