public function deleteKey(Key $key) { $controls = $this->entityManager->getRepository('Concrete\\Core\\Entity\\Express\\Control\\AttributeKeyControl')->findBy(['attribute_key' => $key]); foreach ($controls as $control) { $this->entityManager->remove($control); } $this->entityManager->flush(); parent::deleteKey($key); }