Chapter 3.4: Get Action

In rare cases, you’d like to calculate action in your own way, or to modify attributes actions and fks in Filter.pm. You can do these by overriding get_action. Just to make sure you return a two-element array: the action and its hash value.

The overridden get_action should be:

sub get_action {
  my $self = shift;
 
  my $actions = $self->{ACTIONS};
  my $fks = $self->{FKS};
  do_something 

# if you get $action
  return $action, $actions->{$action};
# or after you have modified the attributes, pass to SUPER
  return $self->SUPER::get_action(@_);
}

Note that get_action runs at Phase 6 in the life circle, before the data collection, ACL and RLS. So at the time of this method, $self->{ARGS} is empty. If you’d like to change something in the 3 later phases, which you can’t access directly, you may do some data manipulations here.