Ojs\SiteBundle\Controller\UserController::deleteCustomFieldAction PHP Метод

deleteCustomFieldAction() публичный Метод

public deleteCustomFieldAction ( Request $request, $id ) : RedirectResponse
$request Symfony\Component\HttpFoundation\Request
$id
Результат Symfony\Component\HttpFoundation\RedirectResponse
    public function deleteCustomFieldAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();
        $customField = $em->find('OjsUserBundle:CustomField', $id);
        if (!$customField) {
            throw new NotFoundException();
        }
        $em->remove($customField);
        $em->flush();
        return $this->redirect($this->get('router')->generate('ojs_user_custom_field'));
    }