|
NAMEInterchange6::Schema::Result::NavigationDESCRIPTIONNavigation is where all navigation, category and static page details are stored. In addition information such as page title can be linked to these records as attributes.
SYNOPSISNOTE: with items such as head_css which may contain more than one record you must set the priority of the record. This ensures each record has a unique value and also allows for proper ordering.$nav->add_attribute({name => 'head_css', priority => '1'}, '/css/main.css'); $nav->add_attribute({name => 'head_css', priority => '2'}, '/css/fancymenu.css'); ACCESSORSnavigation_idPrimary key.uriURI.Unique constraint. Is nullable. See "generate_uri" method for details of how "uri" can be created automatically based on the value of "name". typeType, e.g.: nav, category.scopeScope, e.g.: menu-main, top-login.nameName, e.g.: Hand Tools, Fly Fishing Rods.Defaults to empty string. descriptionDescription, e.g.: All of our hand tools, Our collection of top fly fishing rods.Defaults to empty string. aliasFK on "navigation_id" in Interchange6::Schema::Result::Navigation.Can be used for things such as menus in different languages which link back to the primary navigation menu. Is nullable. parent_idUsed by DBIx::Class::Tree::AdjacencyList to setup parent/child relationships.Is nullable. prioritySigned integer priority. We normally order descending.Defaults to 0. product_countCan be used to cache product counts.Default to 0. createdDate and time when this record was created returned as DateTime object. Value is auto-set on insert.last_modifiedDate and time when this record was last modified returned as DateTime object. Value is auto-set on insert and update.activeWhether navigation is active and therefore should be displayed.Boolean defaults to true (1). METHODSAttribute methods are provided by the Interchange6::Schema::Base::Attribute class.newOverride inherited method to call "generate_uri" method in case "name" has been supplied as an argument but "uri" has not.NOTE: is uri is supplied and is undefined then "generate_uri" is not called. active_child_countSee "with_active_child_count" in Interchange6::Schema::ResultSet::Navigation for a resultset method which will prefill this data.active_product_countSee "with_active_product_count" in Interchange6::Schema::ResultSet::Navigation for a resultset method which will prefill this data.generate_uri($attrs)Called by "new" if no uri is given as an argument.The following steps are taken: 1. Stash
"$self->name" in
$uri to allow manipulation via filters
2. Remove leading and trailing spaces and replace remaining spaces and "/" with "-" 3. Search for all rows in Interchange6::Schema::Result::Setting where "scope" is "Navigation" and "name" is <generate_uri_filter> 4. For each row found eval "$row->value" 5. Finally set the value of column "uri" to $uri Filters stored in Interchange6::Schema::Result::Setting are executed via eval and have access to $uri and also the navigation result held in $self Examples of filters stored in Setting might be: { scope => 'Navigation', name => 'generate_uri_filter', value => '$uri =~ s/badstuff/goodstuff/gi', }, { scope => 'Navigation', name => 'generate_uri_filter', value => '$uri = lc($uri)', }, siblings_with_selfSimilar to the inherited siblings method but also returns the object itself in the result set/list.INHERITED METHODSDBIx::Class::Tree::AdjacencyList
RELATIONSactive_childrenRelated object: Interchange6::Schema::Result::NavigationConditions: self.parent_id = foreign.navigation_id && foreign.active = 1 media_navigationsType: has_manyRelated object: Interchange6::Schema::Result::MediaNavigation navigation_productsType: has_manyRelated object: Interchange6::Schema::Result::NavigationProduct productsType: many_to_manyAccessor to related product results ordered by priority and name. navigation_attributesType: has_manyRelated object: Interchange6::Schema::Result::NavigationAttribute attributesType: many_to_manyAccessor to related attribute results. navigation_messagesType: has_manyRelated object: Interchange6::Schema::Result::NavigationMessage messagesType: many_to_manyAccessor to related Message results.
Visit the GSP FreeBSD Man Page Interface. |