public function setModel(Nextras\Orm\Model\IModel $model) { parent::setModel($model); if ($model instanceof Model) { $this->onAfterPersist[] = $this->onBeforeRemove[] = [$model, 'processEntityCache']; } }