Exemplo n.º 1
0
function getColumnsForLayerOfType($xmlDoc, &$rootNode, $paramsNode) {
  $layer_tablename = $paramsNode->getElementsByTagName('layer_tablename')->item(0)->nodeValue;
  $column_type = $paramsNode->getElementsByTagName('column_type')->item(0)->nodeValue;

  if($layer_tablename == null || $layer_tablename == '' || $column_type == null || $column_type == '') {
    setError($xmlDoc, $rootNode, "Required parameters not set.");
    return;
  } else {
    $col_db_info = getDBColDesc($layer_tablename, null, $column_type, false);
    getTableColDesc($layer_tablename, 'layer', $col_db_info, $xmlDoc, $rootNode, false);

    $cols = array();
    foreach($col_db_info as $key => $val) {
      if(substr($key, 0, strlen(AUTO_DBCOL_PREFIX)) != AUTO_DBCOL_PREFIX) {
        $cols[] = $key;
      }
    }
    $colsinfo = getStartEndDatesForColumns($layer_tablename, $cols);

    $colnodes = $xmlDoc->getElementsByTagName('column');
    $i = 0;
    foreach ($colnodes as $colnode) {
      $colname = $colnode->getAttribute('name');
      $colnode->removeAttribute('type');
      $colnode->setAttribute('startdate', $colsinfo[$colname]['startdate']);
      $colnode->setAttribute('enddate', $colsinfo[$colname]['enddate']);
      $i++;
    }
  }
}
Exemplo n.º 2
0
function getLinkColDesc($xmlDoc, &$rootNode, $paramsNode) {
  $link_tablename = $paramsNode->getElementsByTagName('link_tablename')->item(0)->nodeValue;

  if($link_tablename == null || $link_tablename == '') {
    setError($xmlDoc, $rootNode, "Required parameters not set.");
    return;
  } else {
    $col_db_info = getDBColDesc($link_tablename);
    getTableColDesc($link_tablename, 'link', $col_db_info, $xmlDoc, $rootNode);
  }
}