コード例 #1
0
 /**
  *
  * @param type $idUnidade
  * @return type
  */
 public function filho($idUnidade, $idUnidadeDefault)
 {
     $where = array('SUPERIOR' => $idUnidade);
     $unidades = DaoUnidade::listUnidades($where);
     $aux = array();
     if ($unidades->resultado == true) {
         foreach ($unidades->resultado as $dados) {
             $children = array_change_key_case($dados, CASE_LOWER);
             //checa se já existe tramite.
             $children['checked'] = $this->verificaTramite($idUnidadeDefault, $children['id']);
             //add os filhos.
             $children['filhos'] = $this->filho($children['id'], $idUnidadeDefault);
             $aux[] = $children;
         }
     }
     return $aux;
 }