File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 30
30
:method: `Symfony\\ Component\\ HttpKernel\\ DataCollector\\ DataCollectorInterface::collect `
31
31
method is responsible for storing the collected data in local properties.
32
32
33
+ .. caution ::
34
+
35
+ The :method: `Symfony\\ Component\\ HttpKernel\\ DataCollector\\ DataCollectorInterface::collect ` method is only called once.
36
+ It is not used to "gather" data but is there to "pick up" the data that has been stored by your service.
37
+
33
38
Most of the time, it is convenient to extend
34
39
:class: `Symfony\\ Component\\ HttpKernel\\ DataCollector\\ DataCollector ` and
35
40
populate the ``$this->data `` property (it takes care of serializing the
@@ -71,6 +76,11 @@ collects the method and accepted content types from the request::
71
76
72
77
The getters are added to give the template access to the collected information.
73
78
79
+ .. caution ::
80
+
81
+ If the data that is not directly related to the request or response, you need to make the data accessible to your DataCollector.
82
+ This can be achieved by injecting the service that holds the information you intend to profile into your DataCollector.
83
+
74
84
.. caution ::
75
85
76
86
As the profiler serializes data collector instances, you should not
You can’t perform that action at this time.
0 commit comments