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)
{
$entry = new Entry();
$entry->setUserId(1);
$repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:User');
$user = $repository->find(1);
$entry = new Entry($user);
$form = $this->createFormBuilder($entry)
->add('url', 'url')