From abd0e62eddc6f12434bb0f4bdc9f4f28d1464c48 Mon Sep 17 00:00:00 2001 From: oscarotero Date: Wed, 12 Feb 2014 23:16:32 +0100 Subject: [PATCH] RowCollection::filter accepts an array of possible values --- SimpleCrud/RowCollection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimpleCrud/RowCollection.php b/SimpleCrud/RowCollection.php index 7e92ae7..7dd2afe 100644 --- a/SimpleCrud/RowCollection.php +++ b/SimpleCrud/RowCollection.php @@ -289,7 +289,7 @@ public function filter ($name, $value, $first = false) { $rows = []; foreach ($this->rows as $row) { - if ($row->$name === $value) { + if (($row->$name === $value) || (is_array($value) && in_array($row->$name, $value, true))) { if ($first === true) { return $row; }