symfony - How to use Repository custom functions in a FormType -
the problem i'm facing have create selectbox in form holds parent entities (category entity). managed with: $builder->add('parent', 'entity', array( 'class' => 'kprcentarzdravljabundle:category', 'query_builder' => function($repository) use ($param, $catid) { return $repository->createquerybuilder('p') ->where('p.id != :id , p.parent = :parent') ->setparameters(array('id' => $param, 'parent' => $catid));}, 'property' => 'name', 'required' => false, 'attr' => array('data-placeholder' => '--izaberite opciju--'), )); as u can see pass 2 arguments first current category.id(a category cant own ...