Changeset 22597 for branches/version-2_12-dev/data/class/util/SC_Utils.php
- Timestamp:
- 2013/03/04 09:05:06 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/util/SC_Utils.php
r22590 r22597 1930 1930 * @param integer $max_depth 1931 1931 * @param array $correction 1932 * @param integer $ base_id1932 * @param integer $root_id 1933 1933 * @return array ツリーの配列 1934 1934 */ … … 1994 1994 * @param array $correction 階層構造が含まれている配列 1995 1995 * @param integer $root_id ルートID 1996 * @param boolean $id_only IDだけの配列を返す場合はtrue 1996 1997 * @return array 親ID配列 1997 1998 */ 1998 public static function getTreeTrail($start_id, $primary_key, $glue_key, $correction = array(), $root_id = 0 )1999 public static function getTreeTrail($start_id, $primary_key, $glue_key, $correction = array(), $root_id = 0, $id_only = TRUE) 1999 2000 { 2000 2001 $arrIDToKay = SC_Utils_Ex::makeArrayIDToKey($primary_key, $correction); … … 2002 2003 $arrTrail = array(); 2003 2004 while ($id != $root_id && !SC_Utils_Ex::isBlank($id)) { 2004 $arrTrail[] = $id; 2005 if ($id_only) { 2006 $arrTrail[] = $id; 2007 } else { 2008 $arrTrail[] = $arrIDToKay[$id]; 2009 } 2005 2010 if (isset($arrIDToKay[$id][$glue_key])) { 2006 2011 $id = $arrIDToKay[$id][$glue_key];
Note: See TracChangeset
for help on using the changeset viewer.