/** * {@inheritdoc} */ public function removeAll(array $objects, array $options = []) { if (empty($objects)) { return; } $allOptions = $this->optionsResolver->resolveRemoveAllOptions($options); $itemOptions = $allOptions; $itemOptions['flush'] = false; foreach ($objects as $object) { $this->remove($object, $itemOptions); } if (true === $allOptions['flush']) { $this->objectManager->flush(); } }