Help for this page

Select Code to Download


  1. or download this
    use Moo;
    sub artist { $_[0]->artwork->artist }            # returns a DBIx obj
    sub artist_name { $_[0]->artwork->artist->name } # returns a string
    sub name { $_[0]->artwork->name }                # returns a string
    
  2. or download this
    use Moo;
    sub language { $_[0]->country->language->name } # string
    
  3. or download this
    $rs = $db->resultset('Poem')->search({
        'user.name'     => 'tobyink',
    ...
            ],                          # table aliased here to 'country_2
    +'
        },
    });
    
  4. or download this
      
    while ( my $poem = $rs->next ) {
        say sprintf(q{tobyink doesn't hate "%s" (%s)},
    ...
            $poem->artwork->artist->name,
        );
    }
    
  5. or download this
      
    while ( my $poem = $rs->next ) {
        say sprintf(q{tobyink doesn't hate "%s" (%s)},
    ...
            $poem->artist_name,
        );
    }
    
  6. or download this
    if ( $comment->language eq $play->artist->language ) { ... }
    
  7. or download this
    use Moo;
    
    sub endpoint_data {
        return { map { $_ => $_[0]->$_ } qw/only these fields/ };
    }