original_string: 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);
          }
      }
code: 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);
          }
      }
code_tokens: 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 ) ; } }
docstring: After an entity was removed from database. Here is when EAV values are
  removed from DB.
  
  @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
docstring_tokens: After an entity was removed from database . Here is when EAV values are removed from DB .