Jifty:...ilters(3pm)

πŸ“¦
version 0.78 Β· 2 versions
  • 0.78 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.78 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Jifty::DBI::HasFilters β€” the abstract class for objects that has filters, bestie ✨


🌸 SYNOPSIS 🌸

my $record = Jifty::DBI::Record->new(...);
$record->input_filters( 'Jifty::DBI::Filter::Truncate',
                        'Jifty::DBI::Filter::utf8'
                      );
my @filters = $record->output_filters;

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so picture this: this abstract class is like the group chat for filter stuff β€” it gives you a generic interface for setting and getting input and output data filters on Jifty::DBI objects. That's it, that's the whole vibe.

Lowkey important though: you should NOT use it directly. It's giving "background character who's actually the main character energy" because these classes inherit this interface:

  • Jifty::DBI::Handle
  • Jifty::DBI::Record
  • Jifty::DBI::Column

So it's the blueprint, not the build, iykyk πŸ’…


✨ METHODS ✨

πŸŽ€ input_filters

Returns an array of the input filters. But here's the twist: if the arguments list is not empty, then it sets the input filter instead. So it's a getter-slash-setter, a true dual threat, obsessed 🫢

🌈 output_filters

Deals similarly with the list of output filters, bestie. But β€” and this is the iconic part β€” unless you defined your own list, it returns the reversed list of the input filters. πŸ”₯

So in the common situation you literally don't need to define your own list of output filters. Just use this method to grab the default list based on the input list. Free real estate, no cap.

⭐ filters FILTERS

Sets the input and output filters at the same time, like a combo meal πŸ“

Returns a hash with the keys "input" and "output", whose values are array references to the respective lists. Two keys, two arrayrefs, one method call. Efficient queen behavior πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘

  • Jifty::DBI::Filter

That's the whole page, periodt πŸ’œ Go forth and filter responsibly, bestie 🧚

πŸ’€ Reminder: this was pulled from perl v5.34.0, dated 2022-06-15. Yes, that's the vintage. It ate then and it eats now. 🌟
πŸ“¦ where this page comes from