Craft\NeoService::deleteField PHP Méthode

deleteField() public méthode

Deletes a Neo field from the database.
public deleteField ( craft\FieldModel $neoField )
$neoField craft\FieldModel
    public function deleteField(FieldModel $neoField)
    {
        $transaction = $this->beginTransaction();
        try {
            // Delete the block types
            $blockTypes = $this->getBlockTypesByFieldId($neoField->id);
            foreach ($blockTypes as $blockType) {
                $this->deleteBlockType($blockType);
            }
            $this->commitTransaction($transaction);
        } catch (\Exception $e) {
            $this->rollbackTransaction($transaction);
            throw $e;
        }
    }