symfony - Symfony2 recursive query builder -


i having data-table contains media,docs,pdfs , folders list. same google drive, want show breadcrumb @ top of data-table. data-table reflects changes when clicks on folders through jquery. things ready except breadcrumb. have id of current opened folder don't know how hierarchy root current folder.

currently gives me parent id , name not whole hierarchy.

note :- there no relationship between columns in same table.
entity fields :- id, namedisplay, parentid

$qb = $this->_em->createquerybuilder(); $qb->select("d.parentid,pid.namedisplay")    ->from($this->_entityname, 'd')    ->leftjoin($this->_entityname, 'pid', 'with', 'pid.id = d.parentid')    ->where("d.status=0")    ->andwhere("d.id=" . $id)    ->orderby('d.namedisplay', 'asc'); $data = $qb->getquery()            ->getresult(); return $data; 

any appreciate.
in advance.


Comments

Popular posts from this blog

minify - Minimizing css files -

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -