protected function validateNotExisting($email_or_phone, $val) { try { $bud = Bud::FindBy($email_or_phone, $val); // has this user already been verified? if ($bud->is_email_verified == 1 || $bud->is_phone_verified == 1) { $this->api_die("That {$email_or_phone} is already registered"); } // if it hasn't been verified yet, just delete the bud to recreate him later $bud->delete(); } catch (ModelNotFoundException $e) { } }