* [misc,0.5h] refactor.
This commit is contained in:
@@ -334,6 +334,26 @@ class sqlparser
|
||||
return $condition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get conditions from array.
|
||||
*
|
||||
* @param array $conditions
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getConditionsFromArray($conditions)
|
||||
{
|
||||
if(is_string($conditions)) return $this->operatorCondition($conditions);
|
||||
|
||||
$first = current($conditions);
|
||||
if(!is_array($first) && !in_array($first, array('and', 'or'))) return $this->getCondition($conditions);
|
||||
|
||||
$conditionExprs = array();
|
||||
foreach($conditions as $condition) $conditionExprs[] = $this->getConditionsFromArray($condition);
|
||||
|
||||
return $conditionExprs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get left join.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user