public function afterDelete(Event $event, EntityInterface $entity, ArrayObject $options)
    {
        if (!$this->config('status')) {
            return;
        }

        if (!$options['atomic']) {
            throw new FatalErrorException(__d('field', 'Entities in fieldable tables can only be deleted using transactions. Set [atomic = true]'));
        }

        if (!empty($this->_cache['afterDelete'])) {
            foreach ((array)$this->_cache['afterDelete'] as $field) {
                $field->afterDelete();
            }
            $this->_cache['afterDelete'] = [];
        }

        parent::afterDelete($event, $entity, $options);
    }
public function afterDelete(Event $event, EntityInterface $entity, ArrayObject $options)
    {
        if (!$this->config('status')) {
            return;
        }

        if (!$options['atomic']) {
            throw new FatalErrorException(__d('field', 'Entities in fieldable tables can only be deleted using transactions. Set [atomic = true]'));
        }

        if (!empty($this->_cache['afterDelete'])) {
            foreach ((array)$this->_cache['afterDelete'] as $field) {
                $field->afterDelete();
            }
            $this->_cache['afterDelete'] = [];
        }

        parent::afterDelete($event, $entity, $options);
    }
public function afterDelete ( Event $ event , EntityInterface $ entity , ArrayObject $ options ) { if ( ! $ this -> config ( 'status' ) ) { return ; } if ( ! $ options [ 'atomic' ] ) { throw new FatalErrorException ( __d ( 'field' , 'Entities in fieldable tables can only be deleted using transactions. Set [atomic = true]' ) ) ; } if ( ! empty ( $ this -> _cache [ 'afterDelete' ] ) ) { foreach ( ( array ) $ this -> _cache [ 'afterDelete' ] as $ field ) { $ field -> afterDelete ( ) ; } $ this -> _cache [ 'afterDelete' ] = [ ] ; } parent :: afterDelete ( $ event , $ entity , $ options ) ; }
After an entity was removed from database.

**NOTE:** This method automatically removes all field values from
`eav_values` database table for each entity.

@param \Cake\Event\Event $event The event that was triggered
@param \Cake\Datasource\EntityInterface $entity The entity that was deleted
@param \ArrayObject $options Additional options given as an array
@throws \Cake\Error\FatalErrorException When using this behavior in non-atomic mode
@return void
After an entity was removed from database .