NAME

AxKit::App::TABOO::Data::Product - Product Data objects for TABOO-based Webshop

SYNOPSIS

use AxKit::App::TABOO::Data::Product;
$product = AxKit::App::TABOO::Data::Product->new();
$product->load('*', 't-shirt');

DESCRIPTION

This Data class contains information about a product to be found in the webshop of the site, such as name, a description, URLs to images, prices etc.

It is worth noting that this class is supposed to contain most relevant information about a product, but that some of this information is contained in related classes, particularly AxKit::App::TABOO::Data::Productsubtypes and AxKit::App::TABOO::Data::Productprices. For that reason, the load method will retrieve all the data, and return an object containing objects that are instances of these classes or their plural counterparts. Consult the documentation for these classes for details, and see below for the details on the fields in this class.

METHODS

This class implements two methods, the rest is inherited from AxKit::App::TABOO::Data.

new()

The constructor. Nothing special.

load($prodid)

This reimplemented load method takes as argument a product ID, a string used to identify a product. It will also call the load methods that are needed to ensure that the price information and the product subtypes are included.

STORED DATA

The data is stored in named fields, and for certain uses, it is good to know them. If you want to subclass this class, you might want to use the same names, see the documentation of AxKit::APP::TABOO::Data for more about this.

These are the names of the stored data of this class:

  • prodid - an identifier for the product, a simple word you use to retrieve the desired object.

  • catname - the identifier of a category. It is convenient to classify the product into a category.

  • title - A string meant for human consumption used to provide a short description of the product.

  • descr - A longer description of the product.

  • imgsmallurl - The URL of a small picture of the product suitable for quick viewing.

  • imglargeurl - The URL of a larger picture of the product.

  • imgcaption - A text that can be used as a caption for the pictures.

  • comment - Short comment suitable for including things that doesn't fit anywhere else. May also be used for internal comments not for public viewing.

For prices and subtypes, consult documentation of the appropriate classes.

XML representation

The write_xml() method, implemented in the parent class, can be used to create an XML representation of the data in the object. The above names will be used as element names. The xmlelement() and xmlns() methods can be used to set the name of the root element and the namespace respectively. Usually, it doesn't make sense to change the defaults, which are

  • product

  • http://www.kjetil.kjernsmo.net/software/TABOO/NS/Product/Output

TODO

This is an early release, just to show off what I've been thinking about and ease testing on different platforms. In particular, an elaborate plural version of this class is needed.

FORMALITIES

See AxKit::App::TABOO.