Hi,
I create new function in block controller to delete user by ID. But got error.
Function :-
public function userDelete($getUserID)
{
$userInfo = UserInfo::getByID($getUserID);
if ($userInfo) {
// Delete the user
$userInfo->delete();
}
}
Error :
{"error":{"type":"Doctrine\\DBAL\\Exception\\ForeignKeyConstraintViolationException","message":"An exception occurred while executing 'DELETE FROM Users WHERE uID = ?' with params [49]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`concrete5_saya`.`usersignups`, CONSTRAINT `FK_FEB5D909FD71026C` FOREIGN KEY (`uID`) REFERENCES `Users` (`uID`))"