public function deleteStructure(NeoFieldType $fieldType)
{
$owner = $fieldType->element;
$field = $fieldType->model;
$locale = $this->_getFieldLocale($fieldType);
$transaction = $this->beginTransaction();
try {
$blockStructure = $this->getStructure($fieldType);
if ($blockStructure) {
craft()->structures->deleteStructureById($blockStructure->id);
}
craft()->db->createCommand()->delete('neoblockstructures', ['ownerLocale' => $locale ? $locale : null, 'ownerId' => $owner->id, 'fieldId' => $field->id]);
$this->commitTransaction($transaction);
} catch (\Exception $e) {
$this->rollbackTransaction($transaction);
throw $e;
}
return true;
}