public function getCostCenterChildrenIds($id)
  {
    $ids = array();

    $this->CostCenter->byParent($id)->each(function($CostCenter) use (&$ids)
    {
      if($CostCenter->is_group)
      {
        $ids = array_merge($ids, $this->getCostCenterChildrenIds($CostCenter->id));
      }

      array_push($ids, $CostCenter->id);
    });

    return $ids;
  }
public function getCostCenterChildrenIds($id)
  {
    $ids = array();

    $this->CostCenter->byParent($id)->each(function($CostCenter) use (&$ids)
    {
      if($CostCenter->is_group)
      {
        $ids = array_merge($ids, $this->getCostCenterChildrenIds($CostCenter->id));
      }

      array_push($ids, $CostCenter->id);
    });

    return $ids;
  }
public function getCostCenterChildrenIds ( $ id ) { $ ids = array ( ) ; $ this -> CostCenter -> byParent ( $ id ) -> each ( function ( $ CostCenter ) use ( & $ ids ) { if ( $ CostCenter -> is_group ) { $ ids = array_merge ( $ ids , $ this -> getCostCenterChildrenIds ( $ CostCenter -> id ) ) ; } array_push ( $ ids , $ CostCenter -> id ) ; } ) ; return $ ids ; }
Get cost center children

@param int $id

@return array
An array of arrays as follows: array( $id0, $id1,…)
Get cost center children