![]() |
![]()
| ![]() |
![]()
NAMEInterchange6::Schema::Base::Attribute DESCRIPTIONThe Attribute base class is consumed by classes with attribute relationships like Interchange6::Schema::Result::User, Interchange6::Schema::Result::Navigation and Interchange6::Schema::Result::Product.
SYNOPSIS$navigation_object->add_attribute('meta_title','My very seductive title here!'); METHODSadd_attributeAdd attribute. $base->add_attribute('hair_color', 'blond'); Where 'hair_color' is Attribute and 'blond' is AttributeValue update_attribute_valueUpdate base attribute value $base->update_attribute('hair_color', 'brown'); delete_attributeDelete $base attribute $base->delete_attribute('hair_color', 'purple'); search_attributesReturns 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' }); find_attribute_valueFinds 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}); search_attribute_values
my $product = $schema->resultset('Product')->find({ sku = '123' }); my $av = $product->search_attribute_values( undef, { order_by => 'priority' }, { order_by => 'priority' }); find_or_create_attributeFind or create attribute and attribute_value. find_base_attribute_valueFrom a $base->attribute input $base_attribute, $base_attribute_value is returned.
|