Home » Database » DB_DataObject » Bug #8173
joinAdd() dosn't work
Details
| Submitted | 2006-07-10 13:17 UTC |
|---|---|
| From | skr at condero dot com |
| Status | No Feedback |
| Package | DB_DataObject |
| PHP Version | 5.1.2 |
| OS | Ubuntu 6.06 |
| Roadmaps | (Not assigned) |
Comments
[2006-07-10 13:17 UTC] skr at condero dot com
Description:
------------
I have 3 tables (product, category and a m:n table productCategory). It isn't possible to join with joinAdd from productCategory to category.
DataObject tells "CndCatalog_ProductCategory: ERROR: joinAdd: category has no link with productCategory", but a getLink("category") work.
==========================================================
With debug=1, i got follow debugmessage for the code bellow:
CndCatalog_ProductCategory: CONNECT: Checking for database database_ in options
CndCatalog_Category: CONNECT: Checking for database database_ in options
CndCatalog_Category: links: Loaded links.ini file: /home/skr/svn_work_copy/catalog/trunk/admin/./../classes/catalog_devel.links.ini
CndCatalog_ProductCategory: ERROR: joinAdd: category has no link with productCategory
CndCatalog_Category: GET: id 3 Array
(
)
CndCatalog_Category: find: 1
CndCatalog_Category: CONNECT: Checking for database database_ in options
CndCatalog_Category: databaseStructure: Loaded ini file: /home/skr/svn_work_copy/catalog/trunk/admin/./../classes/catalog_devel.ini
CndCatalog_Category: QUERY: SELECT *
FROM category
WHERE ( category.id = 3 )
CndCatalog_Category: query: QUERY DONE IN 0.00136590003967 seconds
CndCatalog_Category: find: CHECK autofetchd 1
CndCatalog_Category: find: ABOUT TO AUTOFETCH
CndCatalog_Category: FETCH: a:6:{s:2:"id";s:1:"3";s:6:"parent";s:1:"2";s:5:"photo";N;s:4:"name";s:16:"Switch & Bridges";s:7:"sorting";s:2:"16";s:9:"freefield";s:0:"";}
CndCatalog_Category: find: DONE
==========================================================
Entrys from ini and links.ini:
[category]
id = 129
parent = 1
photo = 1
name = 130
sorting = 1
freefield = 194
[category__keys]
id = N
[productCategory]
product = 129
category = 129
sorting = 129
[productCategory__keys]
product = K
category = K
[productCategory]
product = CndCatalog_Product:id
category = CndCatalog_Category:id
Test script:
---------------
$prodCat = CndCatalog_DataObject::factory("CndCatalog_ProductCategory");
$category = CndCatalog_DataObject::factory("CndCatalog_Category");
$prodCat->category = 3;
$prodCat->joinAdd($category);
$prodCat->getLink("category");