Error doctrine table

Discussion relating to version 1.3.x and 1.4.x

Error doctrine table

Postby killo22 » Wed Feb 22, 2012 12:49 pm

Every time I do this:
Code: Select all
foreach($image->ImageTypes as $imageType) {
     if($imageType->slug == 'main-news') {
           $this->mainImage = $image;   
      }
}

I get this error:
Code: Select all
Warning: Invalid argument supplied for foreach() in /var/www/tdf/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Table.php on line 1292


This table is many on many relation.
Image <-> ImageImageType <-> ImageType

I do get the imagetype back, and if I dont have frontend_dev.php on I dont see the error and the page loads correct.
How do I fix this ?
If you need more info, please ask.

Thanks,
killo22
Junior Member
 
Posts: 5
Joined: Wed Feb 22, 2012 12:39 pm

Re: Error doctrine table

Postby killo22 » Thu Feb 23, 2012 11:48 pm

Now when i do
Code: Select all
$tag = Doctrine::getTable('Tag')->findOneBySlug($slug);
foreach($tag->Images as $image) {

I get
Code: Select all
Notice: Undefined property: Tag::$Images in /var/www/tdf/lib/model/doctrine/Tag.class.php on line 24

And it does not get the images related to the tag.

Can anyone help with this?
killo22
Junior Member
 
Posts: 5
Joined: Wed Feb 22, 2012 12:39 pm

Re: Error doctrine table

Postby killo22 » Thu Mar 08, 2012 4:08 pm

Please can anyone help me with this problem ?
killo22
Junior Member
 
Posts: 5
Joined: Wed Feb 22, 2012 12:39 pm

Re: Error doctrine table

Postby killo22 » Tue Jul 17, 2012 10:32 am

I am still getting this error, can someone help me with this ?
killo22
Junior Member
 
Posts: 5
Joined: Wed Feb 22, 2012 12:39 pm


Return to symfony 1.3 and 1.4

Who is online

Users browsing this forum: No registered users and 4 guests