GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Interchange6::Schema::Base::Attribute(3) User Contributed Perl Documentation Interchange6::Schema::Base::Attribute(3)

Interchange6::Schema::Base::Attribute

The Attribute base class is consumed by classes with attribute relationships like Interchange6::Schema::Result::User, Interchange6::Schema::Result::Navigation and Interchange6::Schema::Result::Product.
Assumptions
This module assumes that your using standardized class naming.

example: User in this example is the $base class so UserAttribute, UserAttributeValue class naming would be used. These would also use user_attributes_id and user_attributes_values_id as primary keys. In general follow the example classes listed in description.

    $navigation_object->add_attribute('meta_title','My very seductive title here!');

Add attribute.

    $base->add_attribute('hair_color', 'blond');

Where 'hair_color' is Attribute and 'blond' is AttributeValue

Update base attribute value

    $base->update_attribute('hair_color', 'brown');

Delete $base attribute

    $base->delete_attribute('hair_color', 'purple');

Returns attributes resultset for a $base object

    $rs = $base->search_attributes;

You can pass conditions and attributes to the search like for any DBIx::Class::ResultSet, e.g.:

    $rs = $base->search_attributes(
        undef, { order_by => 'priority desc' });

Finds the attribute value for the current object or a defined object value. If $object is passed the entire attribute_value object will be returned. $args can accept both scalar and hash inputs.

    $base->find_attribute_value({name => $attr_name, priority => $attr_priority}, {object => 1});

Arguments: $cond | undef, \%attrs | undef, \%av_attrs
Where $cond and %attrs are passed to the Attribute search and %av_attrs is passed to the AttributeValue search.
Return Value: Array (or arrayref in scalar context) of attributes and values for for the $base object input.

    my $product = $schema->resultset('Product')->find({ sku = '123' });
    my $av = $product->search_attribute_values(
        undef, { order_by => 'priority' }, { order_by => 'priority' });

Find or create attribute and attribute_value.

From a $base->attribute input $base_attribute, $base_attribute_value is returned.
2014-10-24 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.