From 3bc941e45426822a2b827c17b82bf3f7f41fb6e3 Mon Sep 17 00:00:00 2001 From: Nadar Date: Wed, 14 Feb 2024 14:19:00 +0000 Subject: [PATCH] Add ImportHelper::csvFromResource() method to ImportHelper class --- CHANGELOG.md | 2 +- src/helpers/ImportHelper.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75db313..24c903f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. This projec ## 1.6.0 (14. February 2024) + [#19](https://github.com/luyadev/yii-helpers/pull/19) Fixed issue with ordinal numbers. -+ []() Added `ImportHelper::csvFromResource()` method to import CSV from a resource object like `fopen()`. ++ [#21](https://github.com/luyadev/yii-helpers/pull/21) Added `ImportHelper::csvFromResource()` method to import CSV from a resource object like `fopen()`. ## 1.5.0 (26. October 2023) diff --git a/src/helpers/ImportHelper.php b/src/helpers/ImportHelper.php index a262731..4c0d4ea 100644 --- a/src/helpers/ImportHelper.php +++ b/src/helpers/ImportHelper.php @@ -12,6 +12,14 @@ */ class ImportHelper { + /** + * Import a CSV from a resource and return array. + * + * @param resource $resource + * @param array $options See {{luya\yii\helpers\ExportHelper::csv()}} for all options. + * @return array + * @since 1.6.0 + */ public static function csvFromResource($resource, array $options = []): array { if (!is_resource($resource)) {