Once a record has been deleted, remove the cached result.

@param Model $model
@return bool
18065
public function afterDelete(Model $model) {
        if ($this->settings[$model->alias]['events']['onDelete']) {
            $this->resetCache($model, $model->id);
        }

        return true;
    }
1116622
public function destroy(Model $model)
    {
        $this->mention->where('model_type', get_class($this->model))
            ->where('model_id', $this->model->getKey())
            ->where('recipient_type', get_class($model))
            ->where('recipient_id', $model->getKey())
            ->delete();
    }
1186126
public function delete()
    {
        if ($this->isNewRecord()) {
            throw new DeleteModelException("New models can't be deleted.");
        }

        $this->beforeDelete();
        $this->raiseEvent("BeforeDelete");

        $this->Deleted = true;
        $this->save();

        $this->afterDelete();
        $this->raiseEvent("AfterDelete");
    }
1354349
public static function deleteModel($model)
    {
        foreach(AnnotationManager::getPropertiesAnnotations(BeanFactory::getObjectClass($model), RelationBase::class) as $propertyName => $annotations)
        {
            if(null === $model[$propertyName])
            {
                continue;
            }
            $annotation = $annotations[0];
            Delete::parse($model, $propertyName, $annotation);
        }
    }
586482
public function detach(AbstractModel $model)
    {
        foreach ($this->storage as $key => $storedModel) {
            if ($model === $storedModel) {
                unset($this->storage[$key]);
            }
        }
    }
558319
public function afterValidate(Model $model) {
		if (!empty($model->validationErrors)){
			$model->data[$model->alias] = $this->runtime[$model->alias]['data'];
		}
		
		return true;
	}
943656
public function delete($model, $id) {
		$runtime = $this->runtime[$model->alias];

		$data = array();
		$fields = $this->_normalizeFields($model);
		foreach ($fields as $flag => $date) {
			if (true === $runtime || $flag === $runtime) {
				$data[$flag] = true;
				if ($date) {
					$data[$date] = date('Y-m-d H:i:s');
				}
				if ($flag === $runtime) {
					break;
				}
			}
		}

		$record = $model->find('first', array(
			'fields' => $model->primaryKey,
			'conditions' => array($model->primaryKey => $id),
			'recursive' => -1
		));

		if (!empty($record)) {
			$model->set($model->primaryKey, $id);
			unset($model->data[$model->alias]['modified']);
			unset($model->data[$model->alias]['updated']);
			return $model->save(array($model->alias => $data), false, array_keys($data));
		}

		return true;
	}
276100
public function deleted(Model $model)
    {
        try {
            Croppa::delete('storage/'.$model->getOriginal('path'));
        } catch (Exception $e) {
            Log::error($e->getMessage());
        }
    }
752647
public function remove(Builder $builder, Model $model)
    {
        $table = $model->getVersionTable();

        $query = $builder->getQuery();

        $query->joins = collect($query->joins)->reject(function($join) use ($table)
        {
            return $this->isVersionJoinConstraint($join, $table);
        })->values()->all();
    }
234770
public function delete(AbstractModel $model)
    {
        $array = $model->toArrayCurrent();

        if (empty($array)) {
            throw new \Exception('Error : delete used an empty model');
        }

        return $this->tableGateway->delete($array);
    }
532093
public function block($model)
    {
        $deletedAtLeastOne = false;

        if ($this->friends->count()) {
            foreach ($this->friends as $friend) {
                if ($friend->getKey() == $model->id) {
                    $friend->pivot->delete();
                    $this->resetFriends();

                    $deletedAtLeastOne = true;
                }
            }
        }

        return $deletedAtLeastOne;
    }
408558
public function unlink(Model $model) {
        $this->getRelation($this->getAlias(get_class($model)))->unlink($model);

        return $this;
    }
916219
public function afterValidate(Model $model) {
        if ($this->settings[$model->alias]['resetAfter']) {
            $model->validate = array();
        }

        return true;
    }
1239238
protected function isModelDeletable(Model $model)
    {
        $this->lastUnmetDeleteConditionMessage = null;

        // access rights
        if ( ! $this->isAuthorizedToDelete()) {
            $this->lastUnmetDeleteConditionMessage = $this->getUnmetConditionMessageForAuthorizationFailure();
            return false;
        }

        // delete condition & model configuration
        $info = $this->getModelInformation();

        if ( ! $info->allowDelete()) {
            $this->lastUnmetDeleteConditionMessage = $this->getUnmetConditionMessageForDisallowedFailure();
            return false;
        }

        $condition = $info->deleteCondition();

        if ( ! $condition) {
            return true;
        }

        // Resolve condition and check.
        $strategies = $this->interpretDeleteCondition($condition);

        foreach ($strategies as $strategy => $parameters) {

            /** @var DeleteConditionStrategyFactoryInterface $factory */
            $factory = app(DeleteConditionStrategyFactoryInterface::class);
            $strategy = $factory->make($strategy);

            if ( ! $strategy->check($model, $parameters)) {
                $this->lastUnmetDeleteConditionMessage = $strategy->message();
                return false;
            }
        }

        return true;
    }
140951
public function delete(LayoutModel $model): bool
    {
        $record = LayoutRecord::findOne(['id' => $model->id]);

        if ($record) {
            // Delete all fields for this layout (obsolete because of foreign key cascade)
//            CpNav::$plugin->navigationService->deleteByLayoutId($model->id);

            return $record->delete() === true;
        }

        return false;
    }
73589
public function remove(Model $model = null)
    {
        if (func_num_args() === 0) {
            $this->connection->remove($this);
        } else {
            // avoid remove empty model
            if (is_null($model)) {
                throw new \Exception('[Norm/Collection] Cannot remove null model');
            }

            $this->applyHook('removing', $model);
            $result = $this->connection->remove($this, $model);

            if ($result) {
                $model->reset();
            }

            $this->applyHook('removed', $model);
        }
    }
715671
public function delete(Identifiable $model)
    {
        $model = $this->checkTypeAndReturn($model);
        $this->storage->offsetUnset($model->getId());
        return $this->persistIfNeeded();

    }