added more entity actions (#757)

This commit is contained in:
Björn Weinbrenner
2019-05-10 02:10:37 +02:00
committed by Kevin Papst
parent b1855447b8
commit e619b5fd31
8 changed files with 106 additions and 21 deletions

View File

@@ -76,14 +76,22 @@ class ProjectController extends AbstractController
/**
* @Route(path="/create", name="admin_project_create", methods={"GET", "POST"})
* @Route(path="/create/{customer}", name="admin_project_create_with_customer", methods={"GET", "POST"})
* @Security("is_granted('create_project')")
*
* @param Request $request
* @param Customer|null $customer
* @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
*/
public function createAction(Request $request)
public function createAction(Request $request, ?Customer $customer = null)
{
return $this->renderProjectForm(new Project(), $request);
$project = new Project();
if (null !== $customer) {
$project->setCustomer($customer);
}
return $this->renderProjectForm($project, $request);
}
/**