I came across a very odd problem with yii concerning relations. Let’s say I want to code a timeline, which shows me only that posts, which are in special folders. One post could be in many folders and I can add folders to get the posts of them in my timeline.
This works like a charm. It show’s me only that posts, which are in a folder, that I added in the user_folder table. But there is still one problem: Let’s say I am writing one post in two folders: test and test2. I have added only one folder: “test”.
If I print all folders of that post with foreach($m->folder as $f) { echo $f; }
It shows me only that folders, which I added in the UserFolder table. I want to show all folders, in which this post is, but only want to show that posts, which folder I added in UserFolder…