Prepare for array getRaw()

This commit is contained in:
Dennis Eichhorn 2017-09-05 15:37:44 +02:00 committed by GitHub
parent 4fed8e5a46
commit 03d1073f2c

View File

@ -1708,7 +1708,12 @@ class DataMapperAbstract implements DataMapperInterface
public static function getRaw($primaryKey) : array
{
$query = self::getQuery();
$query->where(static::$table . '.' . static::$primaryField, '=', $primaryKey);
if(is_array($primaryKey)) {
$query->where(static::$table . '.' . static::$primaryField, 'in', $primaryKey);
} else {
$query->where(static::$table . '.' . static::$primaryField, '=', $primaryKey);
}
$sth = self::$db->con->prepare($query->toSql());
$sth->execute();