Closed pulse00 closed 11 years ago
You are right, in this case, it's normal.
$timelineManager->getSubjectActions($component);
return all actions where $component
is the subject.
$timelineManager->getTimeline($component);
return all actions where component was a recipient (from a spread).
By default, all actions created by X are spread to X timeline, but you can change this via spread.on_subject
option:
Imagine now:
Bruce Lee kick Chuck Norris
and you defined a spread to deploy each kick actions on Chuck Norris see spread section.
In this case, when you fetch $timelineManager->getTimeline($chuckComponent);
you'll get the action where Bruce Lee kick Chuck norris.
You can compare it to facebook system.
I hope i'm clear. Feel free to ask another one question.
ps: I created a demo application which can help you: https://github.com/stephpy/timeline-app, but it is for TimelineBundle ORM Doctrine only, but system is identical.
Ahh, alright, thanks for the clarification. spread.on_subject
was what i didn't know about. Now it makes sense!
I have a hard time understanding how this library is supposed to work ;)
Let's take the example from the docs:
1. Add an action
2. Fetch timeline of chuck norris
What should
$timeline
contain?ChuckNorris kick BruceLee
?3. Fetch actions of chuck norris
What should
$timeline
contain?ChuckNorris kick BruceLee
as well?I would have guessed that the subjectActions retrieves all actions the subject has taken.
But when i'm testing this, also the call to
->getTimeline()
returns something likeChuckNorris kick BruceLee
. So basically the timeline and the subject actions contain the same actions.Am i missing something?