Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
namespace NewCoInc\AppBundle\Entity;
use Doctrine\ORM\EntityRepository;
class BlogRepository extends EntityRepository
public function getTags()
$blogTags = $this->createQueryBuilder('b')
$tags = array();
foreach ($blogTags as $blogTag)
$tags = array_merge(explode(",", $blogTag['tags']), $tags);
foreach ($tags as &$tag)
$tag = trim($tag);
return $tags;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment