+ [misc] add columnExistInOriginTable.
This commit is contained in:
@@ -71,6 +71,22 @@ class sqlparser
|
||||
$this->isSelect = $this->statement instanceof PhpMyAdmin\SqlParser\Statements\SelectStatement === true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Judge column exist in origin table or not.
|
||||
*
|
||||
* @param string $table
|
||||
* @param string $column
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function columnExistInOriginTable($table, $column)
|
||||
{
|
||||
$originTable = $this->getOriginTableColumns($table);
|
||||
if(!$originTable) return false;
|
||||
|
||||
return isset($originTable[$column]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get origin table columns.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user