diff --git a/src/Persistence/Sql/Join.php b/src/Persistence/Sql/Join.php index 8a0ed7e536..0d5eb9b484 100644 --- a/src/Persistence/Sql/Join.php +++ b/src/Persistence/Sql/Join.php @@ -131,6 +131,8 @@ public function afterLoad(Model $entity): void public function beforeInsert(Model $entity, array &$data): void { + $this->getForeignModel(); // DEBUG assert modelled join table for write operation + if ($this->weak) { return; } @@ -158,6 +160,8 @@ public function beforeInsert(Model $entity, array &$data): void public function afterInsert(Model $entity): void { + $this->getForeignModel(); // DEBUG assert modelled join table for write operation + if ($this->weak) { return; } @@ -178,6 +182,8 @@ public function afterInsert(Model $entity): void public function beforeUpdate(Model $entity, array &$data): void { + $this->getForeignModel(); // DEBUG assert modelled join table for write operation + if ($this->weak) { return; } @@ -198,6 +204,8 @@ public function beforeUpdate(Model $entity, array &$data): void public function doDelete(Model $entity): void { + $this->getForeignModel(); // DEBUG assert modelled join table for write operation + if ($this->weak) { return; }