DBIx::Class::Helper::Row::SelfResultSet(3pm)

DBIx::Class::Helper::Row::SelfResultSet3pm

Easily use resultset methods for the current row

Usage

In result class:

 __PACKAGE__->load_components('Helper::Row::SelfResultSet');

Elsewhere:

 $row->self_rs->$some_rs_method->single

Overview

Sometimes you need to be able to access a ResultSet containing just the current row. A good reason to do that would be if you had a ResultSet method that adds in some calculated data, like counts of a relationship. You could use this to get at that counted data without duplicating the logic for the counting.

Due to primitives provided by DBIx::Class::PK this references the current values, or in "DBIx::Class" terms, the dirty values. So if you modify the primary columns it will be temporarily incorrect. For what it's worth I'm not married to this behavior and I'd rather you get in touch with me before you depend on it.

Methods

self_rs

 $row->self_rs

returns a ResultSet containing just the current row.

Releases

7 releases since Debian 7 (Wheezy); the text changed 6 times.

  1. 7
  2. 8
  3. 9
  4. 10
  5. 11
  6. 12
  7. 13

Author

Arthur Axel "fREW" Schmidt <[email protected]>

From libdbix-class-helpers-perl 2.037000-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.