Hello,
My Catalogue model:
$this->hasManyToMany(
'id',
'Core\Models\categoriesToCatalogue',
'catalogue_id',
'categorie_id',
'Core\Models\Categories',
'id',
array('alias' => 'categories')
);
Categories Model :
$this->hasManyToMany(
'id',
'Core\Models\categoriesToProduct',
'category_id', 'product_id',
'Core\Models\Products',
'id',
array('alias' => 'products')
);
$this->hasManyToMany(
"id",
"Core\Models\AttributeGroupsToCategory",
"category_id",
"attr_group_id",
"Core\Models\AttributeGroup",
"id",
array('alias' => 'attributes_group')
Is there anyway to make the following code work ?? I need to get all "attributes_group" and "products"
$catalogue = Catalogue::findFirst("link_rewrite = '{$rewrite}'");
$attr_groups = $catalogue->getCategories()->attributes_group;
$products = $catalogue->getCategories()->products;
Thank you in advance :)