Skip to content

Commit

Permalink
Add ImportHelper::csvFromResource() method to ImportHelper class
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Feb 14, 2024
1 parent e415782 commit 3bc941e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 8 additions & 0 deletions src/helpers/ImportHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 3bc941e

Please sign in to comment.