pipes_get_pipe

Definition

pipes_get_pipe($id, $call = 'path')
pipes/pipes.module, line 180

Description

Get information for a pipe

Parameters

s $id = the string or numeric identifier of the pipe $call = the type of identifierm values may be "path" or "pid"

Return value

$pipe = an object populated with data about the pipe

Code

function pipes_get_pipe($id, $call = 'path') {
  switch ($call) {
    case 'path':
      $sql = "SELECT pid, name, url, path FROM {pipes} WHERE path = '%s'";
      $pipe = db_fetch_object(db_query($sql, $id));
      break;
    case 'pid':
       $sql = "SELECT pid, name, url, path FROM {pipes} WHERE pid = %d";
      $pipe = db_fetch_object(db_query($sql, $id));     
            break;
  }
  return $pipe;
}