Term::load (termid) can we get the depth of term. If yes how can we achieve ? If no, how can we achieve this without loading tree nor children is there any other way we can fetch depth?
- You can use TermStorage loadTree function. It will load the whole tree and the depths of each term will be avaiable.
- A much more cleaner / efficient way can be to use the "taxonomy_term_hierarchy" table, (database service, select..). You query over and over again till the "parent" (or current examined) term parent is 0.
If you really feel you are being lost, take a look on this thread.