public function beforeDelete(Event $event, EntityInterface $entity, ArrayObject $options)
    {
        $this->_table->dispatchEvent('Model.beforeRemoveIndex', compact('entity'));
        $success = $this->searchEngine()->delete($entity);
        $this->_table->dispatchEvent('Model.afterRemoveIndex', compact('entity', 'success'));

        return $success;
    }
public function beforeDelete(Event $event, EntityInterface $entity, ArrayObject $options)
    {
        $this->_table->dispatchEvent('Model.beforeRemoveIndex', compact('entity'));
        $success = $this->searchEngine()->delete($entity);
        $this->_table->dispatchEvent('Model.afterRemoveIndex', compact('entity', 'success'));

        return $success;
    }
public function beforeDelete ( Event $ event , EntityInterface $ entity , ArrayObject $ options ) { $ this -> _table -> dispatchEvent ( 'Model.beforeRemoveIndex' , compact ( 'entity' ) ) ; $ success = $ this -> searchEngine ( ) -> delete ( $ entity ) ; $ this -> _table -> dispatchEvent ( 'Model.afterRemoveIndex' , compact ( 'entity' , 'success' ) ) ; return $ success ; }
Prepares entity to delete its words-index.

Triggers the following events:

- `Model.beforeRemoveIndex`: Before entity's index is removed. First argument
is the affected entity instance.

- `Model.afterRemoveIndex`: After entity's index is removed. First argument
is the affected entity instance, and second indicates whether the
index-removing process completed correctly or not.

@param \Cake\Event\Event $event The event that was triggered
@param \Cake\Datasource\EntityInterface $entity The entity that was removed
@param \ArrayObject $options Additional options
@return bool
Prepares entity to delete its words - index .