- Bugfix within PdoObject and Repository

- Added some utilities methods to EntityCollection
This commit is contained in:
Dave Mc Nicoll committed 2020-03-19 09:55:00 -04:00
1 parent d03f9ece36
commit 4b29232543
3 files changed
+13 -4

No files matched your search

+3 -1
View File
@@ -30,12 +30,14 @@ class EntityCollection extends \ArrayObject {
return $collection;
}
public function searchOne($value, string $field) : object
public function searchOne($value, string $field) : ? object
{
# Returning first value only
foreach($this->search($value, $field) as $item) {
return $item;
}
return null;
}
public function search($value, string $field) : Generator