public function getCostCenterChildren($input)
  {
    $CostCenter = $this->CostCenter->byId($input['id']);

    $costCenterTree = array('text' => $CostCenter->key . ' ' . $CostCenter->name, 'state' => array('opened' => true), 'icon' => 'fa fa-sitemap', 'children' => array());

    $this->CostCenter->byParent($input['id'])->each(function($CostCenter) use (&$costCenterTree)
    {
      if($CostCenter->is_group)
      {
        array_push($costCenterTree['children'], array('text' => $CostCenter->key . ' ' . $CostCenter->name, 'icon' => 'fa fa-sitemap'));
      }
      else
      {
        array_push($costCenterTree['children'], array('text' => $CostCenter->key . ' ' . $CostCenter->name, 'icon' => 'fa fa-leaf'));
      }
    });

    return json_encode(array($costCenterTree));
  }