Yii Framework Forum: Not load Relation of Relations - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Not load Relation of Relations Rate Topic: -----

#1 User is offline   Molybtek 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 21-March 10

Posted 11 April 2010 - 06:46 PM

I'm realising that I'm starting to run into memory issues.

I have three tables, and their relations are as follows:
Subscription ->1:1-> Topic ->1:n-> Stories

Are there a way when I retrieve a subscription, it will only return the Topic, but not the Stories?

Or are there a way to completely destroy it after it's used? It seems like there are residue memory usage even after I set subscription variable to null.
0

#2 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 12 April 2010 - 02:43 AM

By default, related objects will not be fetched. Only if you add a with() to the method chain. So check your code and remove the with() call if you don't want that.
0

#3 User is offline   Molybtek 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 21-March 10

Posted 12 April 2010 - 05:57 PM

Thanks Mike, you're right it doesn't load the related objects without the with() call.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users