function extractColumnAlias($node) { //is this a table type or colref/alias? if ((isColref($node) || isFunction($node) || isExpression($node)) && isset($node['alias']['as'])) { $partCounts = count($node['alias']['no_quotes']['parts']); return $node['alias']['no_quotes']['parts'][$partCounts - 1]; } else { //don't know what to do return false; } }
/** * @param mixed $variable * * @return bool */ function isObject($variable) { return is_object($variable) and !isFunction($variable); }