Interchange6-Schema

 view release on metacpan or  search on metacpan

lib/Interchange6/Schema/Result/AttributeValue.pm  view on Meta::CPAN

    size          => 255,
};

=head2 priority

Display order priority.

Defaults to 0.

=cut

column priority => {
    data_type     => "integer",
    default_value => 0,
};

=head1 UNIQUE CONSTRAINT

=head2 attribute_values_attributes_id_value

=over 4

=item * L</attributes_id>

=item * L</value>

=back

=cut

unique_constraint attribute_values_attributes_id_value =>
  [qw/attributes_id value/];

=head1 RELATIONS

=head2 attribute

Type: belongs_to

Related object: L<Interchange6::Schema::Result::Attribute>

=cut

belongs_to
  attribute => "Interchange6::Schema::Result::Attribute",
  { attributes_id => "attributes_id" },
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" };

=head2 product_attribute_values

Type: has_many

Related object: L<Interchange6::Schema::Result::ProductAttributeValue>

=cut

has_many
  product_attribute_values =>
  "Interchange6::Schema::Result::ProductAttributeValue",
  { "foreign.attribute_values_id" => "self.attribute_values_id" },
  { cascade_copy                  => 0, cascade_delete => 0 };

=head2 user_attribute_values

Type: has_many

Related object: L<Interchange6::Schema::Result::UserAttributeValue>

=cut

has_many
  user_attribute_values => "Interchange6::Schema::Result::UserAttributeValue",
  { "foreign.attribute_values_id" => "self.attribute_values_id" },
  { cascade_copy                  => 0, cascade_delete => 0 };

=head2 navigation_attribute_values

Type: has_many

Related object: L<Interchange6::Schema::Result::NavigationAttributeValue>

=cut

has_many
  navigation_attribute_values =>
  "Interchange6::Schema::Result::NavigationAttributeValue",
  { "foreign.attribute_values_id" => "self.attribute_values_id" },
  { cascade_copy                  => 0, cascade_delete => 0 };

=head1 METHODS

=head2 new

Set default value of L</title> to L</name>.

=cut

sub new {
    my ( $class, $attrs ) = @_;

    $attrs->{title} = $attrs->{value} unless defined $attrs->{title};

    my $new = $class->next::method($attrs);

    return $new;
}

1;



( run in 0.997 second using v1.01-cache-2.11-cpan-39bf76dae61 )