src/components/CategoryManager.php
protected function buildPaths ()
		{
			$titles = [];
			$guids = [];

			$n = count($this->_data);
			for ($i = 0; $i < $n; $i++)
			{
				$parent = $this->_data[ $i ];
				for ($j = $i + 1; $j < $n; $j++)
				{
					$child = $this->_data[ $j ];
					if ($child->lft > $parent->lft and $child->rgt < $parent->rgt)
					{
						$titles[ $child->id ][] = $parent->title;
						$guids[ $child->id ][] = $parent->guid;
					}
				}
				$titles[ $parent->id ][] = $parent->title;
				$guids[ $parent->id ][] = $parent->guid;

				$parent->titlePath = implode($this->_titlePathDelimiter, $titles[ $parent->id ]);
				$parent->guidPath = implode($this->_guidPathDelimiter, $guids[ $parent->id ]);
			}
		}
protected function buildPaths ()
		{
			$titles = [];
			$guids = [];

			$n = count($this->_data);
			for ($i = 0; $i < $n; $i++)
			{
				$parent = $this->_data[ $i ];
				for ($j = $i + 1; $j < $n; $j++)
				{
					$child = $this->_data[ $j ];
					if ($child->lft > $parent->lft and $child->rgt < $parent->rgt)
					{
						$titles[ $child->id ][] = $parent->title;
						$guids[ $child->id ][] = $parent->guid;
					}
				}
				$titles[ $parent->id ][] = $parent->title;
				$guids[ $parent->id ][] = $parent->guid;

				$parent->titlePath = implode($this->_titlePathDelimiter, $titles[ $parent->id ]);
				$parent->guidPath = implode($this->_guidPathDelimiter, $guids[ $parent->id ]);
			}
		}
protected function buildPaths ( ) { $ titles = [ ] ; $ guids = [ ] ; $ n = count ( $ this -> _data ) ; for ( $ i = 0 ; $ i < $ n ; $ i ++ ) { $ parent = $ this -> _data [ $ i ] ; for ( $ j = $ i + 1 ; $ j < $ n ; $ j ++ ) { $ child = $ this -> _data [ $ j ] ; if ( $ child -> lft > $ parent -> lft and $ child -> rgt < $ parent -> rgt ) { $ titles [ $ child -> id ] [ ] = $ parent -> title ; $ guids [ $ child -> id ] [ ] = $ parent -> guid ; } } $ titles [ $ parent -> id ] [ ] = $ parent -> title ; $ guids [ $ parent -> id ] [ ] = $ parent -> guid ; $ parent -> titlePath = implode ( $ this -> _titlePathDelimiter , $ titles [ $ parent -> id ] ) ; $ parent -> guidPath = implode ( $ this -> _guidPathDelimiter , $ guids [ $ parent -> id ] ) ; } }
Builds full title and GUID paths for all categories.
Builds full title and GUID paths for all categories .