create an Entry with a User in parameter

This commit is contained in:
Nicolas Lœuillet 2015-02-07 22:32:21 +01:00 committed by Jeremy
parent 5f09650eef
commit 7812f508bc

View File

@ -19,8 +19,9 @@ class EntryController extends Controller
*/ */
public function addEntryAction(Request $request) public function addEntryAction(Request $request)
{ {
$entry = new Entry(); $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:User');
$entry->setUserId(1); $user = $repository->find(1);
$entry = new Entry($user);
$form = $this->createFormBuilder($entry) $form = $this->createFormBuilder($entry)
->add('url', 'url') ->add('url', 'url')