/** * Delete an array of entities. * * @param array $ids * * @return array */ public function deleteEntities($ids) { $entities = parent::deleteEntities($ids); //remove the column from the leads table $leadsSchema = $this->schemaHelperFactory->getSchemaHelper('column', 'leads'); foreach ($entities as $e) { $leadsSchema->dropColumn($e->getAlias()); } $leadsSchema->executeChanges(); }
/** * {@inheritdoc} */ public function deleteEntities($ids) { $entities = parent::deleteEntities($ids); $schemaHelper = $this->schemaHelperFactory->getSchemaHelper('table'); foreach ($entities as $id => $entity) { //delete the associated results table $schemaHelper->deleteTable('form_results_' . $id . '_' . $entity->getAlias()); } $schemaHelper->executeChanges(); return $entities; }