Commit bbc1e62d authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge pull request #448 from deeky666/DBAL-577

[DBAL-577] Fix platform's IN expression
parents fcc09f60 7b09cacc
......@@ -801,37 +801,6 @@ abstract class AbstractPlatform
return 'NOT(' . $expression . ')';
}
/**
* Returns the SQL to check if a value is one in a set of given values.
*
* Accepts an arbitrary number of parameters. The first parameter
* must always specify the value that should be matched against. Successive
* must contain a logical expression or an array with logical expressions.
* These expressions will be matched against the first parameter.
*
* @param string $column The value that should be matched against.
* @param string|string[] $values The values that will be matched against $column.
*
* @return string The logical expression.
*
* @throws \InvalidArgumentException
*/
public function getInExpression($column, $values)
{
if ( ! is_array($values)) {
$values = array($values);
}
// TODO: fix this code: the method does not exist
$values = $this->getIdentifiers($values);
if (count($values) == 0) {
throw new \InvalidArgumentException('Values must not be empty.');
}
return $column . ' IN (' . implode(', ', $values) . ')';
}
/**
* Returns the SQL that checks if an expression is null.
*
......@@ -1057,7 +1026,7 @@ abstract class AbstractPlatform
/**
* Returns the FOR UPDATE expression.
*
*
* @return string
*/
public function getForUpdateSQL()
......@@ -1202,7 +1171,7 @@ abstract class AbstractPlatform
/**
* Returns the SQL to drop a foreign key.
*
*
* @param \Doctrine\DBAL\Schema\ForeignKeyConstraint|string $foreignKey
* @param \Doctrine\DBAL\Schema\Table|string $table
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment