Hi,
ich bin mir nicht sicher, ob ich das alles richtig verstehe, kannst du
vielleicht den Code deiner Models (den ganzen hasOne, hasMany, belongsTo
Kram) schicken? Da du dich scheinbar auch nicht so richtig an die
Namenskonventionen hältst, ist das übersichtlicher. :)
Weil z.B. eine "Friend" Relation ja typischerweise User HABTM User
Relation ist.
Ich denke, wenn die ganzen Relationen ordentlich definiert sind, sollte
das mit dem richtigen Rekursionslevel out of the box funktionieren.
Und wenn du hier auf englisch fragst, sind die Chancen eine gute Antwort
zu erhalten wesentlich höher. ;)
Gruß
Max
Am 11.08.2010 10:30, schrieb JuMiFi:
Hallo liebe Community,
ich habe eine Frage bzgl. hasMany...
Ich habe ein Model "User" (users), welches via hasOne u.a. auf
"Account" (users_accounts) und "File" (users_files) zugreift.
Ausserdem kann es via hasMany auf "Friends" (friends) zugreifen.
users_files beinhaltet die Uploads eines Users (Profilepic etc...).
Jetzt würde ich gerne mit $this->User->findById() nicht nur User,
Account, File und Friends bekommen, sondern für die Friends wiederum
ausserdem File aus users_files und Account aus users_account...
Verknüpfungen laufen natürlich jeweils über user(s)_id bzw.
friend_id....
Strukturell also so:
User
User[Account]
User[File]
User[Friends]
User[Friends][Account]
User[Friends][File]
Danke für eure Hilfe!
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en