src/components/CategoryManager.php
public function getParents ($category)
		{
			if ($category instanceof $this->_modelClass)
			{
				$parents = [];
				foreach ($this->_data as $item)
					if ($category->lft > $item->lft and $category->rgt < $item->rgt)
						$parents[] = $item;

				return $parents;
			}

			return null;
		}
public function getParents ($category)
		{
			if ($category instanceof $this->_modelClass)
			{
				$parents = [];
				foreach ($this->_data as $item)
					if ($category->lft > $item->lft and $category->rgt < $item->rgt)
						$parents[] = $item;

				return $parents;
			}

			return null;
		}
public function getParents ( $ category ) { if ( $ category instanceof $ this -> _modelClass ) { $ parents = [ ] ; foreach ( $ this -> _data as $ item ) if ( $ category -> lft > $ item -> lft and $ category -> rgt < $ item -> rgt ) $ parents [ ] = $ item ; return $ parents ; } return null ; }
Finds all parents from top one to nearest.
@param  Category $category
@return Category[]|null
Finds all parents from top one to nearest .