Amiro.CMS API Reference
Amiro.Ru / Manual
Loading search...

The AmiCatalog_Items_Table class

AMI_ModTable
   |
   --Hyper_AmiCatalog_Table
      |
      --AmiCatalog_Items_Table

• Introduction

AmiCatalog/Items configuration table model.

• Class synopsis

AmiCatalog_Items_Table extends Hyper_AmiCatalog_Table {
/* Inherited Properties */
// Attributes
protected AMI_ModTable::$aAttributes = array();
// Flag specifying extensions are initialized already
protected AMI_ModTable::$extInitialized = array();
// Database table name, must be declared in child classes
protected AMI_ModTable::$tableName = '';
/* Methods */
// Initializing table data.
public __construct ( [ $aAttributes = array() ] ) returns AmiCatalog_Items_Table;
// Returns prefix for eshop and its clones tables.
public getTablePrefix ( ) returns string;
/* Inherited Methods */
// Constructor.
public AMI_ModTable::__construct ( [ $aAttributes = array() ] ) returns AMI_ModTable;
// Returns item model object and add new data without saving.
public AMI_ModTable::add ( [ $aData = array() ] ) returns AMI_ModTableItem;
// Adds validators array for fields.
public AMI_ModTable::addValidators ( $aValidators ) returns AMI_ModTable;
// Drops attribute.
public AMI_ModTable::dropAttr ( string $name ) returns AMI_ModTable;
// Exludes fields not from available list.
public AMI_ModTable::filterFields ( $aFields ) returns array;
// Returns item model object and load data for key field param.
public AMI_ModTable::find ( int $id, [ $aFields = array('*') ] ) returns AMI_ModTableItem;
// Returns item model object and load data for non-primary key field.
public AMI_ModTable::findByFields ( $aSearchCondition, [ $aFields = array('*') ] ) returns AMI_ModTableItem;
// Returns attribute.
public AMI_ModTable::getAttr ( string $name, [ mixed $defaultValue = null ] ) returns mixed;
// Returns array of available fields.
public AMI_ModTable::getAvailableFields ( [ bool $bAppendEventFields = true ] ) returns array;
// Returns dependence resource name.
public AMI_ModTable::getDependenceResId ( string $alias ) returns string|null;
// Returns real field name by its alias.
public AMI_ModTable::getFieldName ( string $alias, [ string $prefix = '' ] ) returns string;
// Called when receive array of validators, allow add own validators.
public AMI_ModTable::getItem ( [ mixed $type = '' ] ) returns void;
// Returns list model object.
public AMI_ModTable::getList ( [ string $type = '' ] ) returns AMI_ModTableList;
// Returns next primary key field value.
public AMI_ModTable::getNextPKValue ( ) returns int|null;
// Event, called for add columns to the query result, a compound derived from the dependent model.
public AMI_ModTable::getQueryBase ( [ mixed $type = '' ], [ mixed $bJoinDependentTables = true ] ) returns void;
// Returns database table name.
public AMI_ModTable::getTableName ( ) returns string;
// Checks if model has a field.
public AMI_ModTable::hasField ( string $name, [ bool $bAppendEventFields = false ] ) returns bool;
// Returns TRUE if attribute is present.
public AMI_ModTable::issetAttr ( string $name ) returns bool;
// Activate or deactivate dependence for the next query.
public AMI_ModTable::setActiveDependence ( string $alias, [ bool $isActive = true ] ) returns mixed;
// Sets attribute.
public AMI_ModTable::setAttr ( string $name, mixed $value ) returns AMI_ModTable;
// Sets table dependences (from other table models for JOIN SQL part).
public AMI_ModTable::setDependence ( string $modId, string $alias, string $condition, [ string $joinType = 'INNER JOIN' ] ) returns void;
// Destructor.
public AMI_ModTable::__destruct ( ) returns void;
// Deinitialize extensions.
protected AMI_ModTable::cleanupExtensions ( ) returns void;
// Returns module id.
protected AMI_ModTable::getModId ( ) returns string;
// Sets passed attributes.
protected AMI_ModTable::initAttributes ( $aAttributes ) returns void;
// Initialize extensions for model.
protected AMI_ModTable::initExtensions ( ) returns void;
// Set pair tableName => moduleId to registry variable tableBlockNames. Used for cache expiring.
protected AMI_ModTable::storeTableBlockName ( ) returns void;
}

• Class Details

Since 6.0.2 this model available for saving (excluding custom fields).

See AMI_ModTable::getAvailableFields() for common fields description.

Fields description:
  • flags - special flags bit mask (int);
  • special_announce - product announce displaying in the special products specblock (string);
  • price - product base price (double);
  • price[1..N] - product extra prices (double);
  • sku - product sku code (string);
  • id_external - product external id used during data exchange (string);
  • letter - product header first letter (char);
  • size - product sizes (string);
  • weight - product weight (double);
  • rest - product rest (int);
  • max_quantity - product max quantity per order (int);
  • tax - product tax value (double);
  • tax_type - product tax value type (abs'|'percent', string);
  • charge_tax_type - product tax charge_type ('charge'|'detach', string);
  • shipping - product shipping value (double);
  • shipping_type - product shipping value type (abs'|'percent', string);
  • discount - product discount value (double);
  • discount_type - product discount value type (abs'|'percent', string);
  • id_source - source product id (used for product copies, int);
  • type - type of item ('eshop_goods'|'eshop_digitals', string);
  • allow_fraction - flag specifying to allow fractional product quantity
during order, since 6.0.2 (0/1);
  • copies_count - count of product copies in other categories (int);
  • custom_field_* - product custom field value (mixed);
  • aCopies - if 'useCopies' attribute is TRUE and product have copies
in other categories, array of category Ids will be loaded / processed,
since 6.0.2 (array);
  • aProperties - if 'loadProperties' attribute is TRUE and product have
properties, array of property models will be loaded, since 6.0.2 (array, read only).
To load copies use:
  • $oTable = AMI::getResourceModel('{$modId}/table')->setAttr('useCopies', TRUE).
To load properties use:
  • $oTable = AMI::getResourceModel('{$modId}/table')->setAttr('loadProperties', TRUE).
Tags:
since 6.0.2
resource {$modId}/table/model AMI::getResourceModel('{$modId}/table')*

• Class Methods

// Initializing table data.
public __construct ( [ $aAttributes = array() ] ) returns AmiCatalog_Items_Table;
  • array $aAttributes
    Attributes of table model

Overrides: AMI_ModTable::__construct().

Tags:
todo Describe several fields
// Returns prefix for eshop and its clones tables.
public getTablePrefix ( ) returns string;