Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
loading data in yml files with joint tables...
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Jonathan Franks  
View profile   Translate to Translated (View Original)
 More options 2 July, 15:46
From: Jonathan Franks <jonat...@ifranks.com>
Date: Thu, 2 Jul 2009 15:46:23 +0100
Local: Thurs 2 July 2009 15:46
Subject: loading data in yml files with joint tables...
I'm having some problems importing data that uses join tables.

I can dump it just fine and I get something as follows....

HollowareItem:
   HollowareItem_89:
     stocknumber: e3916
     name: 'Coffee pots'
   HollowareItem_99:
     stocknumber: e6107
     name: Candlesticks
.......etc
Type:
   Type_1:
     name: Baskets
   Type_3:
     name: 'Biscuit boxes'
.......etc
Typejoin:
   Typejoin_5364_199:
     HollowareItem: HollowareItem_5364
     Type: Type_199
   Typejoin_5373_199:
     HollowareItem: HollowareItem_5373
     Type: Type_199
........etc

but when I try to load the data I get this error....

Unknown method Makerjoin::setHollowareitem

The table and jointable related to HollowareItem are generated by  
behaviors, but I have a filter running to call the following....

Doctrine::initializeModels('HollowareItem');

So, the relationships should be working.

Any suggestions??

Thanks, jb


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Wage  
View profile   Translate to Translated (View Original)
 More options 2 July, 17:24
From: Jonathan Wage <jonw...@gmail.com>
Date: Thu, 2 Jul 2009 11:24:19 -0500
Local: Thurs 2 July 2009 17:24
Subject: Re: [doctrine-user] loading data in yml files with joint tables...

Is that the exact error? The eror says "setHollowareitem", but it is named
"HollowareItem", with a capital "I". Is your code calling the wrong method
somewhere in your code or something?

- Jon

On Thu, Jul 2, 2009 at 9:46 AM, Jonathan Franks <jonat...@ifranks.com>wrote:

--
Jonathan H. Wage (+1 415 992 5468)
Open Source Software Developer & Evangelist
sensiolabs.com | jwage.com | doctrine-project.org | symfony-project.org

You can contact Jonathan about Doctrine, Symfony and Open-Source or for
training, consulting, application development, or business related questions
at jonathan.w...@sensio.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Franks  
View profile   Translate to Translated (View Original)
 More options 2 July, 23:47
From: Jonathan Franks <jonat...@ifranks.com>
Date: Thu, 2 Jul 2009 23:47:24 +0100
Local: Thurs 2 July 2009 23:47
Subject: Re: [doctrine-user] Re: loading data in yml files with joint tables...
Eyes of the hawk!!!

Yes, that is the exact error and I missed it totally. I will  
investigate tomorrow as its bedtime here.

Thanks as always!

Jonathan

On 2 Jul 2009, at 17:24, Jonathan Wage wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Franks  
View profile   Translate to Translated (View Original)
 More options 3 July, 08:34
From: Jonathan Franks <jonat...@ifranks.com>
Date: Fri, 3 Jul 2009 08:34:44 +0100
Local: Fri 3 July 2009 08:34
Subject: Re: [doctrine-user] Re: loading data in yml files with joint tables...
a quick grep of my project shows that 'Hollowareitem' is not there.  
Searching for 'hollowareitem' finds a couple of errors in my log....

log/frontend_dev.log:Jun 25 22:48:43 symfony [err]  
{Doctrine_Table_Exception} Unknown relation alias hollowareitems

But nothing outside of the log.

Weird... Any suggestions??

On 2 Jul 2009, at 17:24, Jonathan Wage wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Franks  
View profile   Translate to Translated (View Original)
 More options 3 July, 10:42
From: Jonathan Franks <jonat...@ifranks.com>
Date: Fri, 3 Jul 2009 10:42:05 +0100
Local: Fri 3 July 2009 10:42
Subject: Re: [doctrine-user] Re: loading data in yml files with joint tables...

Hi Jon -

been doing some testing and unfortunately, the problem appears to be  
more complicated than capitalization. I changed the model name to  
Items and now I'm getting the same error...

Unknown method Makerjoin::setItem

My Maker & Makerjoin tables are both generated with  
Doctrine_Record_Generator classes. The relationships work fine in all  
use cases I've tried so far, except loading data.

The relationship between the Maker table and the Item table is defined  
in the Maker table's Doctrine_Record_Generator class.

   public function buildLocalRelation()
   {
     $options = array('local'    => 'attribute_id',
                      'foreign'  => 'parent_id',
                      'type'     => Doctrine_Relation::MANY,
                      'class'    => $this->_options['table']-
 >getComponentName(),
                      'refClass' => $this-
 >_options['attributeAssociationsClassName']);

     $alias = array_key_exists('foreignAlias', $this->_options) ?  
$this->_options['foreignAlias'] : $this->_options['parent'] . 's';

     $this->_table->getRelationParser()->bind($this-
 >_options['parent'] . ' as ' . $alias, $options);
   }

   public function buildForeignRelation($alias = null)
   {
     $alias = array_key_exists('alias', $this->_options) ? $this-
 >_options['alias'] : $this->_options['attributesClassName'].'s';

     $options = array(
       'foreign'  => 'attribute_id',
       'local'    => 'parent_id',
       'type'     => Doctrine_Relation::MANY,
       'class'    => $this->_options['attributesClassName'],
       'refClass' => $this->_options['attributeAssociationsClassName']
     );

     $this->_options['table']->getRelationParser()->bind($this-
 >_options['attributesClassName'] . ' as ' . $alias, $options);
   }

There is no relationship definition in the Makerjoin  
Doctrine_Record_Generator class. Does there need to be??

I've created a filter to load the 'Item' class to get the  
relationships working.

Any suggestions??

Thanks for your help!!

Jonathan

On 2 Jul 2009, at 17:24, Jonathan Wage wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Wage  
View profile   Translate to Translated (View Original)
 More options 3 July, 16:14
From: Jonathan Wage <jonw...@gmail.com>
Date: Fri, 3 Jul 2009 10:14:37 -0500
Local: Fri 3 July 2009 16:14
Subject: Re: [doctrine-user] Re: loading data in yml files with joint tables...

I'd go in the code and throw an exception and follow the stack trace.

- Jon

On Fri, Jul 3, 2009 at 4:42 AM, Jonathan Franks <jonat...@ifranks.com>wrote:

--
Jonathan H. Wage (+1 415 992 5468)
Open Source Software Developer & Evangelist
sensiolabs.com | jwage.com | doctrine-project.org | symfony-project.org

You can contact Jonathan about Doctrine, Symfony and Open-Source or for
training, consulting, application development, or business related questions
at jonathan.w...@sensio.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google