Class::DBI::Plugin::RetrieveAll - ぷちWiki
最終更新日時:
Class::DBI::Plugin::RetrieveAll とは
Class::DBI::Plugin::RetrieveAll は Class::DBI の retrieve_all メソッドに、任意のカラムでのソート条件を加えることを可能とするプラグインです。
具体的な使い方としては以下のような感じです。
retrieve_all に order by 句を付加
my @by_date = My::Class->retrieve_all_sorted_by("date"); retrieve_all 時のソートのデフォルトを設定
__PACKAGE__->retrieve_all_sort_field('date');
my @by_date = My::Class->retrieve_all;