@@ 139-158 (lines=20) @@ | ||
136 | /** |
|
137 | * {@inheritdoc} |
|
138 | */ |
|
139 | public function getLastActivitiesDateForTarget(EntityManager $em, $target, $direction, $skipId = null) |
|
140 | { |
|
141 | $result = []; |
|
142 | $resultActivity = $this->getLastActivity($em, $target, $skipId); |
|
143 | if ($resultActivity) { |
|
144 | $result['all'] = $this->getDate($resultActivity); |
|
145 | if ($this->getDirection($resultActivity, $target) !== $direction) { |
|
146 | $resultActivity = $this->getLastActivity($em, $target, $skipId, $direction); |
|
147 | if ($resultActivity) { |
|
148 | $result['direction'] = $this->getDate($resultActivity); |
|
149 | } else { |
|
150 | $result['direction'] = null; |
|
151 | } |
|
152 | } else { |
|
153 | $result['direction'] = $result['all']; |
|
154 | } |
|
155 | } |
|
156 | ||
157 | return $result; |
|
158 | } |
|
159 | ||
160 | /** |
|
161 | * @param EntityManager $em |
@@ 69-88 (lines=20) @@ | ||
66 | /** |
|
67 | * {@inheritdoc} |
|
68 | */ |
|
69 | public function getLastActivitiesDateForTarget(EntityManager $em, $target, $direction, $skipId = null) |
|
70 | { |
|
71 | $result = []; |
|
72 | $resultActivity = $this->getLastActivity($em, $target, $skipId); |
|
73 | if ($resultActivity) { |
|
74 | $result['all'] = $this->getDate($resultActivity); |
|
75 | if ($this->getDirection($resultActivity, $target) !== $direction) { |
|
76 | $resultActivity = $this->getLastActivity($em, $target, $skipId, $direction); |
|
77 | if ($resultActivity) { |
|
78 | $result['direction'] = $this->getDate($resultActivity); |
|
79 | } else { |
|
80 | $result['direction'] = null; |
|
81 | } |
|
82 | } else { |
|
83 | $result['direction'] = $result['all']; |
|
84 | } |
|
85 | } |
|
86 | ||
87 | return $result; |
|
88 | } |
|
89 | ||
90 | /** |
|
91 | * @param EntityManager $em |