} else {
my ($first, @rest) = @$data;
- my @names = grep {!ref $first->{$_}} keys %$first;
+ require overload;
+ my @names = grep {
+ (not ref $first->{$_}) || (ref $first->{$_} eq 'SCALAR') ||
+ (overload::Method($first->{$_}, '""'))
+ } keys %$first;
+
my @rels = grep { $self->result_source->has_relationship($_) } keys %$first;
my @pks = $self->result_source->primary_columns;
shift->set_cache(undef);
}
-=head2 is_paginated
+=head2 is_paged
+
+=over 4
+
+=item Arguments: none
+
+=item Return Value: true, if the resultset has been paginated
-Returns true if the resultset has been paginated
+=back
=cut
-sub is_paginated {
+sub is_paged {
my ($self) = @_;
return !!$self->{attrs}{page};
}
attribute, the column names returned are storage-dependent. E.g. MySQL would
return a column named C<count(employeeid)> in the above example.
+B<NOTE:> You will almost always need a corresponding 'as' entry when you use
+'select'.
+
=head2 +select
=over 4
# only return rows WHERE deleted IS NULL for all searches
__PACKAGE__->resultset_attributes({ where => { deleted => undef } }); )
-Can be overridden by passing C<{ where => undef }> as an attribute
-to a resulset.
+Can be overridden by passing C<< { where => undef } >> as an attribute
+to a resultset.
=back