@@ 232-248 (lines=17) @@ | ||
229 | /** |
|
230 | * {@inheritdoc} |
|
231 | */ |
|
232 | public function deleteCollections(Query $query) |
|
233 | { |
|
234 | $collections = $this->ezInfoCollectionRepository |
|
235 | ->findBy([ |
|
236 | 'contentObjectId' => $query->contentId, |
|
237 | 'id' => $query->collections, |
|
238 | ]); |
|
239 | ||
240 | foreach ($collections as $collection) { |
|
241 | $attributes = $this->ezInfoCollectionAttributeRepository->findBy(['informationCollectionId' => $collection->getId()]); |
|
242 | $this->ezInfoCollectionAttributeRepository->remove($attributes); |
|
243 | } |
|
244 | ||
245 | $this->ezInfoCollectionRepository->remove($collections); |
|
246 | } |
|
247 | ||
248 | /** |
|
249 | * {@inheritdoc} |
|
250 | */ |
|
251 | public function deleteCollectionByContent(Query $query) |
|
@@ 251-266 (lines=16) @@ | ||
248 | /** |
|
249 | * {@inheritdoc} |
|
250 | */ |
|
251 | public function deleteCollectionByContent(Query $query) |
|
252 | { |
|
253 | $collections = $this->ezInfoCollectionRepository |
|
254 | ->findBy([ |
|
255 | 'contentObjectId' => $query->contents, |
|
256 | ]); |
|
257 | ||
258 | foreach ($collections as $collection) { |
|
259 | $attributes = $this->ezInfoCollectionAttributeRepository->findBy(['informationCollectionId' => $collection->getId()]); |
|
260 | $this->ezInfoCollectionAttributeRepository->remove($attributes); |
|
261 | } |
|
262 | ||
263 | $this->ezInfoCollectionRepository->remove($collections); |
|
264 | } |
|
265 | ||
266 | /** |
|
267 | * @param int $userId |
|
268 | * |
|
269 | * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException |