The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Rapi::Blog::DB::Result::Section - Section row object

DESCRIPTION

This is the default Section Result class/row object for Rapi::Blog. Posts can optionally be assigned to exactly one section, but sections may be sub-sections of other sections, forming a hierarchy/tree structure.

This is a DBIx::Class::Row.

COLUMNS

id

Auto-increment section id. Read-only.

name

The unique name of the Section at the current location in the hierarchy (i.e. the Section name can be reused if it has a different parent Section).

description

Optionally text description of the Section

parent

The parent Section that this Section belongs to, or undef if this is a top-level Section. This is an FK relationship to another Section row object. parent is a relationship name, the underlying foreign-key column is parent_id which is hidden.

METHODS

posts

Multi-relationship to all the Posts in this Section.

sections

Multi-relationship to all the immediate child Sections in this Section.

parents_name_list

Returns a LIST of all the names of parent Sections up the chain to the top, ordered from child to parent, excluding the name of the calling Section.

full_path_names

Returns the path-ordered (parent to child) Section names, including the name of the calling Section which will be last.

If a delimeter argument is supplied, the list will be returned as a string joined by that delimeter. If no argument is supplied, when called in LIST context the list is returned, when called in SCALAR context, the default delimeter of '/' is used and the path is returned as a joined string.

posts_count

Returns the count of direct Posts in this Section.

sections_count

Returns the count of direct sub-sections of this Section.

SEE ALSO

AUTHOR

Henry Van Styn <vanstyn@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by IntelliTree Solutions llc.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.