Stefan Hornburg (Racke) > Interchange6-Schema-0.015 > Interchange6::Schema::Result::Product

Download:
Interchange6-Schema-0.015.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source   Latest Release: Interchange6-Schema-0.040

NAME ^

Interchange6::Schema::Result::Product

TABLE: products ^

DESCRIPTION ^

The products table contains three product types parent, child and single.

sku:

name:

short_description:

description:

price:

uri: Unique product uri. Example "acme-pro-dumbbells"

weight:

priority: Display order priority.

gtin: EAN or UPC type data.

canonical_sku: If the product is a child of a parent product the parent product sku would be referenced here.

active: Default is true

inventory_exempt:

ACCESSORS ^

sku

  data_type: 'varchar'
  is_nullable: 0
  size: 32

name

  data_type: 'varchar'
  default_value: (empty string)
  is_nullable: 0
  size: 255

short_description

  data_type: 'varchar'
  default_value: (empty string)
  is_nullable: 0
  size: 500

description

  data_type: 'text'
  default_value: (empty string)
  is_nullable: 0

price

  data_type: 'numeric'
  default_value: 0.0
  is_nullable: 0
  size: [10,2]

uri

  data_type: 'varchar'
  is_nullable: 1
  size: 255

weight

  data_type: 'numeric'
  default_value: 0.0
  is_nullable: 0
  size: [10,2]

priority

  data_type: 'integer'
  default_value: 0
  is_nullable: 0

gtin

  data_type: 'varchar'
  is_nullable: 1
  size: 32

canonical_sku

  data_type: 'varchar'
  is_nullable: 1
  size: 32

active

  data_type: 'boolean'
  default_value: true
  is_nullable: 0

inventory_exempt

  data_type: 'boolean'
  default_value: false
  is_nullable: 0

created

  data_type: 'datetime'
  set_on_create: 1
  is_nullable: 0

last_modified

  data_type: 'datetime'
  set_on_create: 1
  set_on_update: 1
  is_nullable: 0

METHODS ^

path

Produces navigation path for this product. Returns array reference in scalar context.

find_variant \%input [\%match_info]

Find product variant with the given attribute values in $input.

Returns variant in case of success.

Returns undef in case of failure.

You can pass an optional hash reference \%match_info which is filled with attribute matches (only valid in case of failure).

attribute_iterator

Returns nested iterator for product attributes.

For canonical products, it shows all the attributes of the child products.

For a child product, it shows all the attributes of the siblings.

add_variants @variants

Add variants from a list of hash references.

Returns product object.

Each hash reference contains attributes and column data which overrides data from the canonical product.

The canonical sku of the variant is automatically set.

Example for the hash reference (attributes in the first line):

     {color => 'yellow', size => 'small',
      sku => 'G0001-YELLOW-S',
      name => 'Six Small Yellow Tulips',
      uri => 'six-small-yellow-tulips'}

PRIMARY KEY ^

UNIQUE CONSTRAINTS ^

products_gtin

products_uri

RELATIONS ^

canonical

Type: belongs_to

Related object: Interchange6::Schema::Result::Product

Variant

Type: has_many

Related object: Interchange6::Schema::Result::Product

CartProduct

Type: has_many

Related object: Interchange6::Schema::Result::CartProduct

GroupPricing

Type: has_many

Related object: Interchange6::Schema::Result::GroupPricing

Inventory

Type: might_have

Related object: Interchange6::Schema::Result::Inventory

MediaDisplay

Type: has_many

Related object: Interchange6::Schema::Result::MediaDisplay

MediaProduct

Type: has_many

Related object: Interchange6::Schema::Result::MediaProduct

MerchandisingProduct

Type: has_many

Related object: Interchange6::Schema::Result::MerchandisingProduct

MerchandisingProductRelated

Type: has_many

Related object: Interchange6::Schema::Result::MerchandisingProduct

NavigationProduct

Type: has_many

Related object: Interchange6::Schema::Result::NavigationProduct

Orderline

Type: has_many

Related object: Interchange6::Schema::Result::Orderline

ProductAttribute

Type: has_many

Related object: Interchange6::Schema::Result::ProductAttribute

syntax highlighting: