Skip to content

Commit

Permalink
Merge pull request #6 from Konafets/feature/MakeImporterFluent
Browse files Browse the repository at this point in the history
Make the Importer fluent
  • Loading branch information
SimoTod authored Aug 31, 2018
2 parents 7939f48 + 0189f49 commit a3274a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ $collection = $excel->getCollection();

The importer class is fluent, then you can also write
```
return Importer::make('Excel')->getCollection($filepath)->getCollection();
return Importer::make('Excel')->load($filepath)->getCollection();
```

### Advanced usage
Expand Down
4 changes: 4 additions & 0 deletions src/Importer/AbstractSpreadsheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ public function __call($name, $args)
public function load($path)
{
$this->path = $path;
return $this;
}

public function setSheet($sheet)
{
$this->sheet = $sheet;
return $this;
}

public function hasHeader($hasHeaderRow)
Expand All @@ -52,11 +54,13 @@ public function hasHeader($hasHeaderRow)
public function setParser(ParserInterface $parser)
{
$this->parser = $parser;
return $this;
}

public function setModel(Model $model)
{
$this->model = $model;
return $this;
}

abstract public function getType();
Expand Down

0 comments on commit a3274a6

Please sign in to comment.