Hi,
Thanks! i changed the code as below:
public function deleteAction(\Hwwcn\Sponsor\Domain\Model\School $school) {
foreach ($school->getAccounts() as $account) {
$school->removeAccount($account);
$this->accountRepository->remove($account);
}
$this->schoolRepository->remove($school);
But still got the same error.