public function afterDelete(Event $event, EntityInterface $entity, ArrayObject $options)
    {
        if (!$options['atomic']) {
            throw new FatalErrorException(__d('eav', 'Entities in fieldable tables can only be deleted using transactions. Set [atomic = true]'));
        }

        $valuesToDelete = TableRegistry::get('Eav.EavValues')
            ->find()
            ->contain('EavAttribute')
            ->where([
                'EavAttribute.table_alias' => $this->_table->table(),
                'EavValues.entity_id' => $this->_toolbox->getEntityId($entity),
            ]);

        foreach ($valuesToDelete as $value) {
            TableRegistry::get('Eav.EavValues')->delete($value);
        }
    }