symfony - Symfony2/Doctrine - Get tags by blog -


I am trying to remove a way to get the tag through blog I know that you can get all the blogs just And can use the loop to get every blog tag, but using this method I am unable to select a different tag, instead of just selecting one tag, there is an end to all tags.

What I'm trying to do here:

Tags are set as blog strings in the blog entity.

I am trying to work together ceramically, it does not work - what's missing in it?

  public function getTagsByBlog () {$ blogTags = $ it- & gt; CreateQueryBuilder ('B') - & gt; Select ('BID') - & gt; Where ('baid =: tag') - & gt; Setpamator ('tag', 'betags'); Return $ blog tag- & gt; GetQuery () - & gt; GetResult (); }   

/ ** * set tag * * @lost string $ tag * @ return blog * / public function set tag ($ tag ) {$ This-> Tag = $ tag; $ This return; } / ** * Get tag * * @ Return string * / public function getTags () {return $ this- & gt; Tag; } You must choose from the tag table by linking to the blog (inside the blog repository),

$ blogTags = $ this- & gt; CreateQueryBuilder ('Tag') - & gt; Select ('tag. Id') - & gt; Bayangon ('tag blog', 'blog') - & gt; Where ('Blog.id =: blogId') - & gt; Setpalmator ('blog id', $ blog id);

This will generate a query with all the tag IDs related to the blog, which has the ID = $ blogId.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -