hi ignace! Thank you so much for answering! In the meanwhile i've read the documentation and tried to do a few experiments but i am still confused.. At the moment, I'm working with categories rather than products (it's a bit easier): i have a structure like this (in the db):
table culture
-------------
cultureId - e.g. 1
locale - e.g. en_US
displayName -e.g. English
flagIcon - eg enUS_flag.jpg
isDefault - eg 1 (default locale)
table category
-----------------
categoryId - e.g. 1
parentId - e.g. 0
table category_locale
---------------------
categoryId - e.g. 1 (refers to category table)
cultureId - e.g. 1 (refers to culture table)
name - e.g. Books
description - e.g. A collection of our Books
ident - books (this is a unique string in DB)
I've 3 classes, Culture, Category and CategoryLocale. Their structure is more or less as follows:
class Category extends Zend_Db_Table_Abstract
{
protected $_name = 'category';
protected $_primary = 'categoryId';
protected $_rowClass = 'Category_Item';
protected $_dependentTables = array ('CategoryLocale');
protected $_referenceMap = array(
'SubCategory' => array(
'columns' => 'parentId',
'refTableClass' => 'Storefront_Resource_Category',
'refColumns' => 'categoryId',
)
);
...
}
class CategoryLocale extends Zend_Db_Table_Abstract
{
protected $_name = 'category_locale';
protected $_primary = array('categoryId','cultureId');
protected $_rowClass = 'CategoryLocale_Item';
protected $_referenceMap = array(
'Category' => array(
'columns' => 'categoryId',
'refColumns' => 'categoryId',
'refTableClass' => 'Category'
),
'Language' => array(
'columns' => 'cultureId',
'refColumns' => 'cultureId',
'refTableClass' => 'Culture'
)
);
...
}
class Culture extends Zend_Db_Table_Abstract
{
protected $_name = 'culture';
protected $_primary = 'cultureId';
protected $_rowClass = 'Culture_Item';
protected $_dependentTables = array ('CategoryLocale');
...
}
In addition, I have a 4th class, Catalog, which contains attributes such as the chosen Culture ($_culture), etc. which is used by Controllers (as well as Action View Helper) to interact with other models... So in this Catalog class I want to have a public method getAllCategories() which will proxy a call to a method getAllCategoriesByLanguage($Culture) of Category..
My question is: how can I retrieve a RowSet containing all the relevant fields representing a category (categoryId, parentId, name, description, ident) using zend_db_table functionalities?
I am really blocked on this and hope somebody will help me (the doc didn't unfortunately)!
Thanks again!
Bye