public function getObjectIds()
  {
    if ($this->object_ids)
      return $this->object_ids;

    if (!$this->node_ids)
      return array();

    $tree = Limb :: toolkit()->getTree();
    if (!$nodes = Limb :: toolkit()->getTree()->getNodesByIds($this->node_ids))
      return array();

    $this->object_ids = ComplexArray :: getColumnValues('object_id', $nodes);

    return $this->object_ids;
  }
  public function getObjectIds()
  {
    if ($this->object_ids)
      return $this->object_ids;

    $tree = Limb :: toolkit()->getTree();
    if(!$nodes = $tree->getSubBranchByPath($this->path,
                                               $this->depth,
                                               $this->include_parent,
                                               $this->check_expanded_parents))
    {
      return array();
    }

    $this->object_ids = ComplexArray :: getColumnValues('object_id', $nodes);

    return $this->object_ids;
  }
  static function _doSort($tree_array, & $sorted_tree_array, $sort_params, $parent_id, $id_hash, $parent_hash)
  {
    $children = array();

    foreach($tree_array as $index => $item)
    {
      if($item[$parent_hash] == $parent_id)
      {
        $children[] = $item;
        unset($tree_array[$index]);
      }
    }

    if(!($count = sizeof($children)))
      return;

    $children = ComplexArray :: sortArray($children, $sort_params);

    if(!$sorted_tree_array)
    {
      $sorted_tree_array = $children;
    }
    else
    {
      $ids = ComplexArray :: getColumnValues($id_hash, $sorted_tree_array);

      $offset = array_search($parent_id, $ids) + 1;

      array_splice($sorted_tree_array, $offset, 0, $children);
    }

    for($i=0; $i < $count; $i++)
    {
      TreeSorter :: _doSort($tree_array, $sorted_tree_array, $sort_params, $children[$i][$id_hash], $id_hash, $parent_hash);
    }
  }
 public function searchFetchSubBranch($path, $loader_class_name, &$counter, $params = array(), $fetch_method = 'fetch')
 {
     $tree = Limb::toolkit()->getTree();
     $site_object = Limb::toolkit()->createSiteObject($loader_class_name);
     if (!isset($params['restrict_by_class']) || isset($params['restrict_by_class']) && (bool) $params['restrict_by_class']) {
         $class_id = $site_object->getClassId();
     } else {
         $class_id = null;
     }
     if (isset($params['check_expanded_parents'])) {
         $check_expanded_parents = (bool) $params['check_expanded_parents'];
     } else {
         $check_expanded_parents = false;
     }
     if (isset($params['include_parent'])) {
         $include_parent = (bool) $params['include_parent'];
     } else {
         $include_parent = false;
     }
     $depth = isset($params['depth']) ? $params['depth'] : 1;
     if (!($nodes = $tree->getAccessibleSubBranchByPath($path, $depth, $include_parent, $check_expanded_parents, $class_id))) {
         return array();
     }
     $object_ids = ComplexArray::getColumnValues('object_id', $nodes);
     if (!count($object_ids)) {
         return array();
     }
     return $this->searchFetchByIds($object_ids, $loader_class_name, $counter, $params, $fetch_method);
 }
  function getMinColumnValue($column_name, $array, &$index)
  {
    $index = 0;

    if(!$values = ComplexArray :: getColumnValues($column_name, $array))
      return false;

    $min = min($values);

    $index = array_search($min, $values);

    return $min;
  }
  public function fetchBackLinksNodeIds($target_node_id, $groups_ids = array())
  {
    $links = $this->fetchBackLinks($target_node_id, $groups_ids);

    return ComplexArray :: getColumnValues('linker_node_id', $links);
  }