Marcus Ramberg > MojoMojo-0.999018 > MojoMojo::Schema::Page

Download:
MojoMojo-0.999018.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Source   Latest Release: MojoMojo-0.999023

path_pages

Accepts a path in url/unix directory format, e.g. "/page1/page2". Paths are assumed to be absolute, so a leading slash (/) is not required. Returns an array of any pages that exist in the path, starting with "/", and an additional array of "proto page" hahses for any pages at the end of the path that do not exist. All paths include the root (/), which must exist, so a path of at least one element will always be returned. The "proto page" hash keys are:

path_pages_by_id

@path_pages = __PACKAGE__->path_pages_by_id( $id );

Returns all the pages in the path to a page, given that page's id.

parse_path <path>

Create prototype page objects for each level in a given path.

normalize_name <orig_name>

Strip superfluos spaces, and convert the rest to _, and lowercase the result.

resolve_path <%args>

Takes the following args:

path_pages
proto_pages
query_pages
current_depth
final_depth

returns true if path can be resolved, or false otherwise.

update_content <%args>

Create a new content version for this page.

args is each column of MojoMojo::M::Core::Content.

set_paths

__PACKAGE__->set_paths( @pages );

Sets the path TEMP columns for multiple pages, either a subtree or a group of non-adjacent pages.

descendants_by_date
  @descendants = $page->descendants_by_date;

Like descendants, but returns pages sorted by the dates of their last content release dates.

others_tags <user>

Return popular tags for this page used by other people than <user>.

create_path_pages

find or creates a list of path_pages

open_gap

Opens a gap in the nested set numbers to allow the inserting of new pages into the tree. Since nested sets number each node twice, the size of the gap is always twice the number of new pages. Also, since nested sets number the nodes from left to right, we determine what nodes to re-number according to the rgt column of the parent of the top-most new node.

Returns a new parent object that is updated with the new lft rgt nested set numbers.

has_photos

return the number of photos attached to this page. use for galleries.