Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-15-2008, 02:20 PM
Junior Member
 
Join Date: Aug 2007
Posts: 6
Default problem with Zend_Db_Table relation

Hello,

I want to get some datas of two tables, but I will get an error message:

Fatal error: Uncaught exception 'Zend_Db_Table_Exception' with message 'No reference from table Country to table Prdtype' ...

CountryController.php
PHP Code:
...
$country = new Country();
$countryRowset $country->fetchAll(array('int_code = ?' => 'de'));
$country $countryRowset->current();
$produktname $country->findParentRow('prdtype');
... 
Model Country.php
PHP Code:
class Country extends Zend_Db_Table_Abstract  {
   protected 
$_name 'country';
   protected 
$_primary 'id';
   protected 
$_referenceMap = array(
     
'Type' => array(
    
'columns'        =>    array('id_prd_type'),
    
'refTableClass'    =>    'prdtype',
    
'refColumns'    =>    'id'
     
)
   );

Model Prdtype.php
PHP Code:
class Prdtype extends Zend_Db_Table_Abstract  {
  protected 
$_name 'prdtype';
  protected 
$_primary 'id';
  protected 
$_dependentTables = array('Country');

Thanks for help in advance!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:29 AM.