Hi guys, I can not find documentation on the subject: I look /classes/Product.php, and i can not understand how arrays are defined here:
class ProductCore extends ObjectModel
{
***
public static $definition = array(
'table' => 'product',
'primary' => 'id_product',
'multilang' => true,
'multilang_shop' => true,
'fields' => array(
*** SOME FIELDS ***
)
'associations' => array(
'manufacturer' => array('type' => self::HAS_ONE),
'supplier' => array('type' => self::HAS_ONE),
'default_category' => array('type' => self::HAS_ONE, 'field' => 'id_category_default', 'object' => 'Category'),
'tax_rules_group' => array('type' => self::HAS_ONE),
'categories' => array('type' => self::HAS_MANY, 'field' => 'id_category', 'object' => 'Category', 'association' => 'category_product'),
'stock_availables' => array('type' => self::HAS_MANY, 'field' => 'id_stock_available', 'object' => 'StockAvailable', 'association' => 'stock_availables'),
),
);
***
}
I'm interested in the string:
'categories' => array('type' => self::HAS_MANY, 'field' => 'id_category', 'object' => 'Category', 'association' => 'category_product'),
Apparently, there is given a link from one product and a few categories. I want to make an analogy in my module, but I can not figure out which fields that are responsible for:
array('type' => self::HAS_MANY, 'field' => 'WHAT IS IT?', 'object' => 'WHAT IS IT?', 'association' => 'WHAT IS IT?')
Help me understand?
Thanks!!!