I have created a symphony unit form-type and a query builder has been used to get the entities.
My Querybuilder looks like this:
$ qb = $ this -> Em - & gt; GetRepository ('namespace \ existance \ domain \ nk') - & gt; CreateQueryBuilder ('domainNic') - & gt; ('DomainNic.article', 'article') - & gt; And where ('article.category =: domainCategory') - & gt; SetParameter ('domainCategory', paragraph :: CATEGORY_DOMAINS) - & gt; Order By ('article.title');
My form type definition looks like this:
$ manufacturer-> gt; Addition ('with', 'bootstrap_collection', array ('allow_add' = & gt; true, 'allow_delete' = & gt; true, 'add_button_text' = & gt; 'adext', 'deletebutton_text' = & gt; ; 'Delayetext', 'Type' =>, 'Unit', 'sub_widij_col' = & gt; 5, 'label' = & gt; '***', 'option' = & gt; array ('class' = & Gt; 'Namespace \ unit \ domain \ NIC', 'query_builder' = & gt; $ qb, 'property' = & gt; 'title')));
The result looks like this, but for every record, Symphony does not use data from the query builder. Instead, Symphony retrieves the title for each record.
Any solutions know? I want to use Symphony data from query builder.
You have an additional select
line in the query builder:
$ qb = $ this - & gt; Em - & gt; GetRepository ('Namespace \ unit \ domain \ Nick') - & gt; CreateQueryBuilder ('domainNic') - & gt; Add Selection ('Articles') // & lt; ---------------- THIS - & gt; Join ('domainNic.article', 'article') - & gt; And where ('article.category =: domainCategory') - & gt; Set Parameter ('domainCategory', paragraph :: CATEGORY_DOMAINS) - & gt; Order By ('article.title');
Comments
Post a Comment