From 080ccd63ed5d2a6c7e2d2bff4bc1feb7011f8903 Mon Sep 17 00:00:00 2001 From: Awilum Date: Sun, 19 Jul 2020 11:19:05 +0300 Subject: [PATCH] feat(element-queries): restore back doctrine collections #436 --- src/flextype/Support/Collection.php | 11 ++--------- src/flextype/Support/helpers.php | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 src/flextype/Support/helpers.php diff --git a/src/flextype/Support/Collection.php b/src/flextype/Support/Collection.php index af55fa48..b1a217f2 100644 --- a/src/flextype/Support/Collection.php +++ b/src/flextype/Support/Collection.php @@ -88,13 +88,6 @@ class Collection */ private $criteria; - /** - * Error Reporting - * - * @access private - */ - private $errorReporting; - /** * Create a new collection. * @@ -488,13 +481,13 @@ class Collection public function all() : array { // Mute notices if there is no requested fields to search inside the items. - error_reporting($errorReporting = error_reporting() & ~E_NOTICE); + //error_reporting($errorReporting = error_reporting() & ~E_NOTICE); // Match collection $collection = $this->collection->matching($this->criteria); // Restore error_reporting - error_reporting($errorReporting); + //error_reporting($errorReporting); // Gets a native PHP array representation of the collection. $results = $collection->toArray(); diff --git a/src/flextype/Support/helpers.php b/src/flextype/Support/helpers.php new file mode 100644 index 00000000..d74f3709 --- /dev/null +++ b/src/flextype/Support/helpers.php @@ -0,0 +1,23 @@ +